diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c38b0a70276..97c9115ca48 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -13,6 +13,7 @@ "packages/google-cloud-bigquery-datatransfer": "3.1.5", "packages/google-cloud-bigquery-reservation": "2.0.4", "packages/google-cloud-certificatemanager": "0.6.2", + "packages/google-cloud-channel": "2.2.0", "packages/google-cloud-contentwarehouse": "0.1.2", "packages/google-cloud-dataplex": "2.2.2", "packages/google-cloud-dataproc": "4.1.1", diff --git a/packages/google-cloud-channel/.OwlBot.yaml b/packages/google-cloud-channel/.OwlBot.yaml new file mode 100644 index 00000000000..ba0bd87b81c --- /dev/null +++ b/packages/google-cloud-channel/.OwlBot.yaml @@ -0,0 +1,21 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/channel/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-channel/$1 + diff --git a/packages/google-cloud-channel/.eslintignore b/packages/google-cloud-channel/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-channel/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-channel/.eslintrc.json b/packages/google-cloud-channel/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-channel/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-channel/.gitattributes b/packages/google-cloud-channel/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-channel/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-channel/.gitignore b/packages/google-cloud-channel/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-channel/.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-channel/.jsdoc.js b/packages/google-cloud-channel/.jsdoc.js new file mode 100644 index 00000000000..40f6e639a6f --- /dev/null +++ b/packages/google-cloud-channel/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/channel', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-channel/.mocharc.js b/packages/google-cloud-channel/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-channel/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-channel/.nycrc b/packages/google-cloud-channel/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-channel/.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-channel/.prettierignore b/packages/google-cloud-channel/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-channel/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-channel/.prettierrc.js b/packages/google-cloud-channel/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-channel/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-channel/.repo-metadata.json b/packages/google-cloud-channel/.repo-metadata.json new file mode 100644 index 00000000000..b6e8faff817 --- /dev/null +++ b/packages/google-cloud-channel/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/channel/latest", + "api_id": "cloudchannel.googleapis.com", + "distribution_name": "@google-cloud/channel", + "release_level": "stable", + "default_version": "v1", + "language": "nodejs", + "name_pretty": "Cloud Channel API", + "repo": "googleapis/google-cloud-node", + "product_documentation": "https://cloud.google.com/channel/", + "requires_billing": true, + "name": "cloudchannel", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "api_shortname": "cloudchannel", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-channel/CHANGELOG.md b/packages/google-cloud-channel/CHANGELOG.md new file mode 100644 index 00000000000..9f0dabe6a76 --- /dev/null +++ b/packages/google-cloud-channel/CHANGELOG.md @@ -0,0 +1,178 @@ +# Changelog + +## [2.2.0](https://github.com/googleapis/nodejs-channel/compare/v2.1.0...v2.2.0) (2022-11-11) + + +### Features + +* Add CloudChannelReportsService to CloudChannel API ([56ab14f](https://github.com/googleapis/nodejs-channel/commit/56ab14fcfb242de8a767cb4c52444728404dc5ad)) +* Add deal_code field to message Offer ([#169](https://github.com/googleapis/nodejs-channel/issues/169)) ([56ab14f](https://github.com/googleapis/nodejs-channel/commit/56ab14fcfb242de8a767cb4c52444728404dc5ad)) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#165](https://github.com/googleapis/nodejs-channel/issues/165)) ([f307d9f](https://github.com/googleapis/nodejs-channel/commit/f307d9f9560dc07a8e0c3e36972b1af2519f8aca)) +* Better support for fallback mode ([#160](https://github.com/googleapis/nodejs-channel/issues/160)) ([24e2202](https://github.com/googleapis/nodejs-channel/commit/24e220281861c3a1b4e4ee8931c53c478635ec8f)) +* Change import long to require ([#161](https://github.com/googleapis/nodejs-channel/issues/161)) ([6c79b81](https://github.com/googleapis/nodejs-channel/commit/6c79b81b8957826c264f44b68b972afd80bcbe6d)) +* **deps:** Use google-gax v3.5.2 ([#172](https://github.com/googleapis/nodejs-channel/issues/172)) ([05aa559](https://github.com/googleapis/nodejs-channel/commit/05aa5596a60309fa175b9f20068e722580e2fe42)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-channel/issues/1553)) ([#164](https://github.com/googleapis/nodejs-channel/issues/164)) ([f3c4901](https://github.com/googleapis/nodejs-channel/commit/f3c490112a9ceb5ff8c200290489cdb0fd971054)) +* Preserve default values in x-goog-request-params header ([#166](https://github.com/googleapis/nodejs-channel/issues/166)) ([c04c515](https://github.com/googleapis/nodejs-channel/commit/c04c515049598c1f4353e64e1e94731f8c72324e)) +* Regenerated protos JS and TS definitions ([#175](https://github.com/googleapis/nodejs-channel/issues/175)) ([fbbb62c](https://github.com/googleapis/nodejs-channel/commit/fbbb62c7b3cbaa36129412a7ca9aaa5613817260)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-channel/issues/1546)) ([#163](https://github.com/googleapis/nodejs-channel/issues/163)) ([a784132](https://github.com/googleapis/nodejs-channel/commit/a78413205e4b7a14897f439c4d37fe2d62a343e2)) +* use google-gax v3.3.0 ([f3c4901](https://github.com/googleapis/nodejs-channel/commit/f3c490112a9ceb5ff8c200290489cdb0fd971054)) + +## [2.1.0](https://github.com/googleapis/nodejs-channel/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#156](https://github.com/googleapis/nodejs-channel/issues/156)) ([2082b3f](https://github.com/googleapis/nodejs-channel/commit/2082b3fdb4b1214ae9a70fa9e575231167a02a06)) + +## [2.0.0](https://github.com/googleapis/nodejs-channel/compare/v1.7.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#149) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/local-auth to v2 ([#150](https://github.com/googleapis/nodejs-channel/issues/150)) ([bab70db](https://github.com/googleapis/nodejs-channel/commit/bab70db6eb59f73d15f2a80cc99e51b83eb9f1bf)) + + +### Build System + +* update library to use Node 12 ([#149](https://github.com/googleapis/nodejs-channel/issues/149)) ([7e1f923](https://github.com/googleapis/nodejs-channel/commit/7e1f9233f502af839b00a7fcbb2ca10017c5e026)) + +## [1.7.0](https://github.com/googleapis/nodejs-channel/compare/v1.6.0...v1.7.0) (2022-05-06) + + +### Features + +* Add API definitions for Cloud Channel Repricing APIs ([#142](https://github.com/googleapis/nodejs-channel/issues/142)) ([682993d](https://github.com/googleapis/nodejs-channel/commit/682993da96720de44fb2c705d9636234a75cbeba)) + +## [1.6.0](https://github.com/googleapis/nodejs-channel/compare/v1.5.0...v1.6.0) (2022-02-05) + + +### Features + +* Change description for enum default value ([#120](https://github.com/googleapis/nodejs-channel/issues/120)) ([3b23a95](https://github.com/googleapis/nodejs-channel/commit/3b23a9556ce8fbf17ab5a8bfbd1697f69efcc689)) +* Change description for GCP ProvisionedService.provisioning_id value ([0b364e8](https://github.com/googleapis/nodejs-channel/commit/0b364e808302e058c1c8da24a91ec61a3024af27)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-channel/compare/v1.4.0...v1.5.0) (2021-10-27) + + +### Features + +* add resource type to ChannelPartnerLink ([#103](https://www.github.com/googleapis/nodejs-channel/issues/103)) ([f8d5b31](https://www.github.com/googleapis/nodejs-channel/commit/f8d5b3197062591ce38c2d648412e7c80f0d5fc3)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-channel/compare/v1.3.0...v1.4.0) (2021-09-07) + + +### Features + +* add API ImportCustomer for Cloud Channel API docs: update comments for a few fields ([#89](https://www.github.com/googleapis/nodejs-channel/issues/89)) ([9d34eba](https://www.github.com/googleapis/nodejs-channel/commit/9d34eba73691c71fd219fc6e9faa4e6a6102e1f4)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.6...v1.3.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#85](https://www.github.com/googleapis/nodejs-channel/issues/85)) ([65dae67](https://www.github.com/googleapis/nodejs-channel/commit/65dae67657fc23358570ff6c0ef8fc7dd39c1cb9)) + +### [1.2.6](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.5...v1.2.6) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#83](https://www.github.com/googleapis/nodejs-channel/issues/83)) ([3bc61ee](https://www.github.com/googleapis/nodejs-channel/commit/3bc61ee644201ed01eb978a646cd95fa8ba9621e)) + +### [1.2.5](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.4...v1.2.5) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#81](https://www.github.com/googleapis/nodejs-channel/issues/81)) ([1818a9e](https://www.github.com/googleapis/nodejs-channel/commit/1818a9e5744ddce7799b75d2e094155bb84aa993)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.3...v1.2.4) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#71](https://www.github.com/googleapis/nodejs-channel/issues/71)) ([096ac96](https://www.github.com/googleapis/nodejs-channel/commit/096ac96502d91645cf5c539bc94bcf46599d9533)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.3...v1.2.4) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#71](https://www.github.com/googleapis/nodejs-channel/issues/71)) ([096ac96](https://www.github.com/googleapis/nodejs-channel/commit/096ac96502d91645cf5c539bc94bcf46599d9533)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.2...v1.2.3) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#69](https://www.github.com/googleapis/nodejs-channel/issues/69)) ([28ec9c7](https://www.github.com/googleapis/nodejs-channel/commit/28ec9c77e2ff3d87a51a6acd82dc0ea09c4a399a)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.1...v1.2.2) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#66](https://www.github.com/googleapis/nodejs-channel/issues/66)) ([2bb861e](https://www.github.com/googleapis/nodejs-channel/commit/2bb861ecafe3851d97429aca7fdb9dbc47f1c4d5)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-channel/compare/v1.2.0...v1.2.1) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#60](https://www.github.com/googleapis/nodejs-channel/issues/60)) ([97f7100](https://www.github.com/googleapis/nodejs-channel/commit/97f7100ac2cc40a783ec2bcd5a535f4e5999889d)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-channel/compare/v1.1.2...v1.2.0) (2021-06-08) + + +### Features + +* Add/Update API definitions for Cloud Channel API, including ([#55](https://www.github.com/googleapis/nodejs-channel/issues/55)) ([3db17ba](https://www.github.com/googleapis/nodejs-channel/commit/3db17ba086e1da649e905ba4235c1dc64bd1a883)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-channel/compare/v1.1.1...v1.1.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#51](https://www.github.com/googleapis/nodejs-channel/issues/51)) ([107499a](https://www.github.com/googleapis/nodejs-channel/commit/107499a1eec09021e72ad8b1b75f644f6644f8a9)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-channel/compare/v1.1.0...v1.1.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#43](https://www.github.com/googleapis/nodejs-channel/issues/43)) ([542e361](https://www.github.com/googleapis/nodejs-channel/commit/542e361d7f932359b0f793d4d3781be089360de1)) +* use require() to load JSON protos ([#46](https://www.github.com/googleapis/nodejs-channel/issues/46)) ([e6bd7c9](https://www.github.com/googleapis/nodejs-channel/commit/e6bd7c9765f102577a9b3d84c3f8b88b36571df5)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-channel/compare/v1.0.0...v1.1.0) (2021-03-02) + + +### Features + +* add Pub/Sub endpoints for Cloud Channel API ([#11](https://www.github.com/googleapis/nodejs-channel/issues/11)) ([b960424](https://www.github.com/googleapis/nodejs-channel/commit/b9604240d4ec9d4a5dcf897f32bdde9601a9e34a)) +* addition of billing_account field on Plan. docs: clarification that valid address lines are required for all customers. ([#17](https://www.github.com/googleapis/nodejs-channel/issues/17)) ([2aaf1c0](https://www.github.com/googleapis/nodejs-channel/commit/2aaf1c05df23b2c4b833d2d2306f6d91dd6385c8)) + + +### Bug Fixes + +* **deps:** update dependency google-auth-library to v7 ([#15](https://www.github.com/googleapis/nodejs-channel/issues/15)) ([bf83cd4](https://www.github.com/googleapis/nodejs-channel/commit/bf83cd46b0be42acca06ce413471a82826ad83b8)) +* TransferableSkus field deprecation. Okay to make this change since no clients are using the libraries that were released just last week. The fields were supposed to be deprecated but missed. We have communicated to clients about ([1328ee7](https://www.github.com/googleapis/nodejs-channel/commit/1328ee72f6df6673db77c9aed58a9e5146363c3b)) + +## 1.0.0 (2021-01-13) + + +### ⚠ BREAKING CHANGES + +* initial stub of library + +### Features + +* initial samples and tests ([#3](https://www.github.com/googleapis/nodejs-channel/issues/3)) ([8b62dff](https://www.github.com/googleapis/nodejs-channel/commit/8b62dff1ef30649bcecadde8e862dce85446a2de)) +* initial stub of library ([ed34624](https://www.github.com/googleapis/nodejs-channel/commit/ed34624b07494fcab099b621d5e60a8c5e107a1d)) diff --git a/packages/google-cloud-channel/CODE_OF_CONDUCT.md b/packages/google-cloud-channel/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-channel/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-channel/CONTRIBUTING.md b/packages/google-cloud-channel/CONTRIBUTING.md new file mode 100644 index 00000000000..dcfb85ad300 --- /dev/null +++ b/packages/google-cloud-channel/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Channel API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudchannel.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-channel/LICENSE b/packages/google-cloud-channel/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-channel/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-channel/README.md b/packages/google-cloud-channel/README.md new file mode 100644 index 00000000000..9a1e6ab0d7c --- /dev/null +++ b/packages/google-cloud-channel/README.md @@ -0,0 +1,296 @@ +[//]: # "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 + +# [Cloud Channel API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/channel.svg)](https://www.npmjs.org/package/@google-cloud/channel) + + + + +Channel client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-channel/CHANGELOG.md). + +* [Cloud Channel API Node.js Client API Reference][client-docs] +* [Cloud Channel API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-channel](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-channel) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Channel API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/channel +``` + + +### Using the client library + +```javascript +// Reads the secrets from a `oauth2.keys.json` file, which should be downloaded +// from the Google Developers Console and saved in the same directory with the +// sample app. + +// This sample app only calls read-only methods from the Channel API. Include +// additional scopes if calling methods that modify the configuration. +const SCOPES = ['https://www.googleapis.com/auth/apps.order']; + +async function listCustomers(authClient, accountNumber) { + // Imports the Google Cloud client library + const {CloudChannelServiceClient} = require('@google-cloud/channel'); + + // Instantiates a client using OAuth2 credentials. + const sslCreds = grpc.credentials.createSsl(); + const credentials = grpc.credentials.combineChannelCredentials( + sslCreds, + grpc.credentials.createFromGoogleCredential(authClient) + ); + + // Instantiates a client + const client = new CloudChannelServiceClient({ + sslCreds: credentials, + }); + + // Calls listCustomers() method + const customers = await client.listCustomers({ + parent: `accounts/${accountNumber}`, + }); + console.info(customers); +} + +/** + * Create a new OAuth2Client, and go through the OAuth2 content + * workflow. Return the full client to the callback. + */ +function getAuthenticatedClient(keys) { + return new Promise((resolve, reject) => { + // Create an oAuth client to authorize the API call. Secrets are kept in a + // `keys.json` file, which should be downloaded from the Google Developers + // Console. + const oAuth2Client = new OAuth2Client( + keys.web.client_id, + keys.web.client_secret, + // The first redirect URL from the `oauth2.keys.json` file will be used + // to generate the OAuth2 callback URL. Update the line below or edit + // the redirect URL in the Google Developers Console if needed. + // This sample app expects the callback URL to be + // 'http://localhost:3000/oauth2callback' + keys.web.redirect_uris[0] + ); + + // Generate the url that will be used for the consent dialog. + const authorizeUrl = oAuth2Client.generateAuthUrl({ + access_type: 'offline', + scope: SCOPES.join(' '), + }); + + // Open an http server to accept the oauth callback. In this example, the + // only request to our webserver is to /oauth2callback?code= + const server = http + .createServer(async (req, res) => { + try { + if (req.url.indexOf('/oauth2callback') > -1) { + // Acquire the code from the querystring, and close the web + // server. + const qs = new url.URL(req.url, 'http://localhost:3000') + .searchParams; + const code = qs.get('code'); + console.log(`Code is ${code}`); + res.end('Authentication successful! Please return to the console.'); + server.destroy(); + + // Now that we have the code, use that to acquire tokens. + const r = await oAuth2Client.getToken(code); + // Make sure to set the credentials on the OAuth2 client. + oAuth2Client.setCredentials(r.tokens); + console.info('Tokens acquired.'); + resolve(oAuth2Client); + } + } catch (e) { + reject(e); + } + }) + .listen(3000, () => { + // Open the browser to the authorize url to start the workflow. + // This line will not work if you are running the code in the + // environment where a browser is not available. In this case, + // copy the URL and open it manually in a browser. + console.info(`Opening the browser with URL: ${authorizeUrl}`); + open(authorizeUrl, {wait: false}).then(cp => cp.unref()); + }); + destroyer(server); + }); +} + +async function main(accountNumber, keys) { + // TODO: uncomment with your account number + // const accountNumber = '1234' + + // TODO: uncomment this line with your oAuth2 file + //const keys = require('./oauth2.keys.json'); + + getAuthenticatedClient(keys).then(authClient => + listCustomers(authClient, accountNumber) + ); +} + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Cloud_channel_reports_service.fetch_report_results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js,samples/README.md) | +| Cloud_channel_reports_service.list_reports | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js,samples/README.md) | +| Cloud_channel_reports_service.run_report_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js,samples/README.md) | +| Cloud_channel_service.activate_entitlement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js,samples/README.md) | +| Cloud_channel_service.cancel_entitlement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js,samples/README.md) | +| Cloud_channel_service.change_offer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js,samples/README.md) | +| Cloud_channel_service.change_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js,samples/README.md) | +| Cloud_channel_service.change_renewal_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js,samples/README.md) | +| Cloud_channel_service.check_cloud_identity_accounts_exist | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js,samples/README.md) | +| Cloud_channel_service.create_channel_partner_link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js,samples/README.md) | +| Cloud_channel_service.create_channel_partner_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js,samples/README.md) | +| Cloud_channel_service.create_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js,samples/README.md) | +| Cloud_channel_service.create_customer_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js,samples/README.md) | +| Cloud_channel_service.create_entitlement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js,samples/README.md) | +| Cloud_channel_service.delete_channel_partner_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js,samples/README.md) | +| Cloud_channel_service.delete_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js,samples/README.md) | +| Cloud_channel_service.delete_customer_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js,samples/README.md) | +| Cloud_channel_service.get_channel_partner_link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js,samples/README.md) | +| Cloud_channel_service.get_channel_partner_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js,samples/README.md) | +| Cloud_channel_service.get_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js,samples/README.md) | +| Cloud_channel_service.get_customer_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js,samples/README.md) | +| Cloud_channel_service.get_entitlement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js,samples/README.md) | +| Cloud_channel_service.import_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js,samples/README.md) | +| Cloud_channel_service.list_channel_partner_links | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js,samples/README.md) | +| Cloud_channel_service.list_channel_partner_repricing_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js,samples/README.md) | +| Cloud_channel_service.list_customer_repricing_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js,samples/README.md) | +| Cloud_channel_service.list_customers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js,samples/README.md) | +| Cloud_channel_service.list_entitlements | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js,samples/README.md) | +| Cloud_channel_service.list_offers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js,samples/README.md) | +| Cloud_channel_service.list_products | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js,samples/README.md) | +| Cloud_channel_service.list_purchasable_offers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js,samples/README.md) | +| Cloud_channel_service.list_purchasable_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js,samples/README.md) | +| Cloud_channel_service.list_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js,samples/README.md) | +| Cloud_channel_service.list_subscribers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js,samples/README.md) | +| Cloud_channel_service.list_transferable_offers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js,samples/README.md) | +| Cloud_channel_service.list_transferable_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js,samples/README.md) | +| Cloud_channel_service.lookup_offer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js,samples/README.md) | +| Cloud_channel_service.provision_cloud_identity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js,samples/README.md) | +| Cloud_channel_service.register_subscriber | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js,samples/README.md) | +| Cloud_channel_service.start_paid_service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js,samples/README.md) | +| Cloud_channel_service.suspend_entitlement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js,samples/README.md) | +| Cloud_channel_service.transfer_entitlements | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js,samples/README.md) | +| Cloud_channel_service.transfer_entitlements_to_google | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js,samples/README.md) | +| Cloud_channel_service.unregister_subscriber | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js,samples/README.md) | +| Cloud_channel_service.update_channel_partner_link | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js,samples/README.md) | +| Cloud_channel_service.update_channel_partner_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js,samples/README.md) | +| Cloud_channel_service.update_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js,samples/README.md) | +| Cloud_channel_service.update_customer_repricing_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/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-channel/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/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-channel/samples/test/quickstart.js,samples/README.md) | + + + +The [Cloud Channel API Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/channel@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/channel/latest +[product-docs]: https://cloud.google.com/channel/ +[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=cloudchannel.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-channel/linkinator.config.json b/packages/google-cloud-channel/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-channel/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-channel/package.json b/packages/google-cloud-channel/package.json new file mode 100644 index 00000000000..d5513d1d275 --- /dev/null +++ b/packages/google-cloud-channel/package.json @@ -0,0 +1,71 @@ +{ + "name": "@google-cloud/channel", + "version": "2.2.0", + "description": "Channel client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-channel", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google channel", + "channel", + "cloud channel service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-channel" +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto new file mode 100644 index 00000000000..fb301586ea8 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto @@ -0,0 +1,95 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ChannelPartnerLinksProto"; +option java_package = "com.google.cloud.channel.v1"; + +// The level of granularity the [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] will display. +enum ChannelPartnerLinkView { + // The default / unset value. + // The API will default to the BASIC view. + UNSPECIFIED = 0; + + // Includes all fields except the + // [ChannelPartnerLink.channel_partner_cloud_identity_info][google.cloud.channel.v1.ChannelPartnerLink.channel_partner_cloud_identity_info]. + BASIC = 1; + + // Includes all fields. + FULL = 2; +} + +// ChannelPartnerLinkState represents state of a channel partner link. +enum ChannelPartnerLinkState { + // Not used. + CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED = 0; + + // An invitation has been sent to the reseller to create a channel partner + // link. + INVITED = 1; + + // Status when the reseller is active. + ACTIVE = 2; + + // Status when the reseller has been revoked by the distributor. + REVOKED = 3; + + // Status when the reseller is suspended by Google or distributor. + SUSPENDED = 4; +} + +// Entity representing a link between distributors and their indirect +// resellers in an n-tier resale channel. +message ChannelPartnerLink { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/ChannelPartnerLink" + pattern: "accounts/{account}/channelPartnerLinks/{channel_partner_link}" + }; + + // Output only. Resource name for the channel partner link, in the format + // accounts/{account_id}/channelPartnerLinks/{id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Cloud Identity ID of the linked reseller. + string reseller_cloud_identity_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. State of the channel partner link. + ChannelPartnerLinkState link_state = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. URI of the web page where partner accepts the link invitation. + string invite_link_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of when the channel partner link is created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of when the channel partner link is updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Public identifier that a customer must use to generate a transfer token + // to move to this distributor-reseller combination. + string public_id = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Identity info of the channel partner (IR). + CloudIdentityInfo channel_partner_cloud_identity_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto new file mode 100644 index 00000000000..175d044e63b --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto @@ -0,0 +1,152 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/any.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Required Edu Attributes +message EduData { + // Enum to specify the institute type. + enum InstituteType { + // Not used. + INSTITUTE_TYPE_UNSPECIFIED = 0; + + // Elementary/Secondary Schools & Districts + K12 = 1; + + // Higher Education Universities & Colleges + UNIVERSITY = 2; + } + + // Number of students and staff the institute has. + enum InstituteSize { + // Not used. + INSTITUTE_SIZE_UNSPECIFIED = 0; + + // 1 - 100 + SIZE_1_100 = 1; + + // 101 - 500 + SIZE_101_500 = 2; + + // 501 - 1,000 + SIZE_501_1000 = 3; + + // 1,001 - 2,000 + SIZE_1001_2000 = 4; + + // 2,001 - 5,000 + SIZE_2001_5000 = 5; + + // 5,001 - 10,000 + SIZE_5001_10000 = 6; + + // 10,001 + + SIZE_10001_OR_MORE = 7; + } + + // Designated institute type of customer. + InstituteType institute_type = 1; + + // Size of the institute. + InstituteSize institute_size = 2; + + // Web address for the edu customer's institution. + string website = 3; +} + +// Cloud Identity information for the Cloud Channel Customer. +message CloudIdentityInfo { + // CustomerType of the customer + enum CustomerType { + // Not used. + CUSTOMER_TYPE_UNSPECIFIED = 0; + + // Domain-owning customer which needs domain verification to use services. + DOMAIN = 1; + + // Team customer which needs email verification to use services. + TEAM = 2; + } + + // CustomerType indicates verification type needed for using services. + CustomerType customer_type = 1; + + // Output only. The primary domain name. + string primary_domain = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the domain is verified. + // This field is not returned for a Customer's cloud_identity_info resource. + // Partners can use the domains.get() method of the Workspace SDK's + // Directory API, or listen to the PRIMARY_DOMAIN_VERIFIED Pub/Sub event in + // to track domain verification of their resolve Workspace customers. + bool is_domain_verified = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The alternate email. + string alternate_email = 6; + + // Phone number associated with the Cloud Identity. + string phone_number = 7; + + // Language code. + string language_code = 8; + + // Output only. URI of Customer's Admin console dashboard. + string admin_console_uri = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Edu information about the customer. + EduData edu_data = 22; +} + +// Data type and value of a parameter. +message Value { + // The kind of value. + oneof kind { + // Represents an int64 value. + int64 int64_value = 1; + + // Represents a string value. + string string_value = 2; + + // Represents a double value. + double double_value = 3; + + // Represents an 'Any' proto value. + google.protobuf.Any proto_value = 4; + + // Represents a boolean value. + bool bool_value = 5; + } +} + +// Information needed to create an Admin User for Google Workspace. +message AdminUser { + // Primary email of the admin user. + string email = 1; + + // Given name of the admin user. + string given_name = 2; + + // Family name of the admin user. + string family_name = 3; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto new file mode 100644 index 00000000000..e34432f2e67 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto @@ -0,0 +1,110 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/postal_address.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "CustomersProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Entity representing a customer of a reseller or distributor. +message Customer { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Customer" + pattern: "accounts/{account}/customers/{customer}" + }; + + // Output only. Resource name of the customer. + // Format: accounts/{account_id}/customers/{customer_id} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Name of the organization that the customer entity represents. + string org_display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The organization address for the customer. To enforce US laws and + // embargoes, we require a region and zip code. You must provide valid + // addresses for every customer. To set the customer's language, use the + // Customer-level language code. + google.type.PostalAddress org_postal_address = 3 [(google.api.field_behavior) = REQUIRED]; + + // Primary contact info. + ContactInfo primary_contact_info = 4; + + // Secondary contact email. You need to provide an alternate email to create + // different domains if a primary contact email already exists. Users will + // receive a notification with credentials when you create an admin.google.com + // account. Secondary emails are also recovery email addresses. Alternate + // emails are optional when you create Team customers. + string alternate_email = 5; + + // Required. The customer's primary domain. Must match the primary contact + // email's domain. + string domain = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Time when the customer was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the customer was updated. + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The customer's Cloud Identity ID if the customer has a Cloud + // Identity resource. + string cloud_identity_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more + // information, see + // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + string language_code = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Cloud Identity information for the customer. + // Populated only if a Cloud Identity account exists for this customer. + CloudIdentityInfo cloud_identity_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Identity ID of the customer's channel partner. + // Populated only if a channel partner exists for this customer. + string channel_partner_id = 13; +} + +// Contact information for a customer account. +message ContactInfo { + // The customer account contact's first name. Optional for Team customers. + string first_name = 1; + + // The customer account contact's last name. Optional for Team customers. + string last_name = 2; + + // Output only. The customer account contact's display name, formatted as a + // combination of the customer's first and last name. + string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The customer account's contact email. Required for entitlements that create + // admin.google.com accounts, and serves as the customer's username for those + // accounts. Use this email to invite Team customers. + string email = 5; + + // Optional. The customer account contact's job title. + string title = 6 [(google.api.field_behavior) = OPTIONAL]; + + // The customer account's contact phone number. + string phone = 7; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto new file mode 100644 index 00000000000..35da239384e --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto @@ -0,0 +1,250 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/cloud/channel/v1/offers.proto"; +import "google/cloud/channel/v1/products.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "EntitlementsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// An entitlement is a representation of a customer's ability to use a service. +message Entitlement { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Entitlement" + pattern: "accounts/{account}/customers/{customer}/entitlements/{entitlement}" + }; + + // Indicates the current provisioning state of the entitlement. + enum ProvisioningState { + // Not used. + PROVISIONING_STATE_UNSPECIFIED = 0; + + // The entitlement is currently active. + ACTIVE = 1; + + // The entitlement is currently suspended. + SUSPENDED = 5; + } + + // Suspension reason for an entitlement if [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] = SUSPENDED. + enum SuspensionReason { + // Not used. + SUSPENSION_REASON_UNSPECIFIED = 0; + + // Entitlement was manually suspended by the Reseller. + RESELLER_INITIATED = 1; + + // Trial ended. + TRIAL_ENDED = 2; + + // Entitlement renewal was canceled. + RENEWAL_WITH_TYPE_CANCEL = 3; + + // Entitlement was automatically suspended on creation for pending ToS + // acceptance on customer. + PENDING_TOS_ACCEPTANCE = 4; + + // Other reasons (internal reasons, abuse, etc.). + OTHER = 100; + } + + // Output only. Resource name of an entitlement in the form: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the entitlement is created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the entitlement is updated. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The offer resource name for which the entitlement is to be + // created. Takes the form: accounts/{account_id}/offers/{offer_id}. + string offer = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Offer" + } + ]; + + // Commitment settings for a commitment-based Offer. + // Required for commitment based offers. + CommitmentSettings commitment_settings = 12; + + // Output only. Current provisioning state of the entitlement. + ProvisioningState provisioning_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service provisioning details for the entitlement. + ProvisionedService provisioned_service = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Enumerable of all current suspension reasons for an entitlement. + repeated SuspensionReason suspension_reasons = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This purchase order (PO) information is for resellers to use for their + // company tracking usage. If a purchaseOrderId value is given, it appears in + // the API responses and shows up in the invoice. The property accepts up to + // 80 plain text characters. This is only supported for Google Workspace + // entitlements. + string purchase_order_id = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Settings for trial offers. + TrialSettings trial_settings = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Association information to other entitlements. + AssociationInfo association_info = 23; + + // Extended entitlement parameters. When creating an entitlement, valid + // parameter names and values are defined in the + // [Offer.parameter_definitions][google.cloud.channel.v1.Offer.parameter_definitions]. + // + // The response may include the following output-only Parameters: + // + // - assigned_units: The number of licenses assigned to users. + // + // - max_units: The maximum assignable units for a flexible offer. + // + // - num_units: The total commitment for commitment-based offers. + repeated Parameter parameters = 26; +} + +// Definition for extended entitlement parameters. +message Parameter { + // Name of the parameter. + string name = 1; + + // Value of the parameter. + Value value = 2; + + // Output only. Specifies whether this parameter is allowed to be changed. For example, for + // a Google Workspace Business Starter entitlement in commitment plan, + // num_units is editable when entitlement is active. + bool editable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Association links that an entitlement has to other entitlements. +message AssociationInfo { + // The name of the base entitlement, for which this entitlement is an add-on. + string base_entitlement = 1 [(google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + }]; +} + +// Service provisioned for an entitlement. +message ProvisionedService { + // Output only. Provisioning ID of the entitlement. For Google Workspace, this is the + // underlying Subscription ID. For Google Cloud Platform, this is the + // Billing Account ID of the billing subaccount." + string provisioning_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The product pertaining to the provisioning resource as specified in the + // Offer. + string product_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The SKU pertaining to the provisioning resource as specified in the Offer. + string sku_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Commitment settings for commitment-based offers. +message CommitmentSettings { + // Output only. Commitment start timestamp. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Commitment end timestamp. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Renewal settings applicable for a commitment-based Offer. + RenewalSettings renewal_settings = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Renewal settings for renewable Offers. +message RenewalSettings { + // If false, the plan will be completed at the end date. + bool enable_renewal = 1; + + // If true and enable_renewal = true, the unit (for example seats or licenses) + // will be set to the number of active units at renewal time. + bool resize_unit_count = 2; + + // Describes how a reseller will be billed. + PaymentPlan payment_plan = 5; + + // Describes how frequently the reseller will be billed, such as + // once per month. + Period payment_cycle = 6; +} + +// Settings for trial offers. +message TrialSettings { + // Determines if the entitlement is in a trial or not: + // + // * `true` - The entitlement is in trial. + // * `false` - The entitlement is not in trial. + bool trial = 1; + + // Date when the trial ends. The value is in milliseconds + // using the UNIX Epoch format. See an example [Epoch + // converter](https://www.epochconverter.com). + google.protobuf.Timestamp end_time = 2; +} + +// TransferableSku represents information a reseller needs to view existing +// provisioned services for a customer that they do not own. +// Read-only. +message TransferableSku { + // Describes the transfer eligibility of a SKU. + TransferEligibility transfer_eligibility = 9; + + // The SKU pertaining to the provisioning resource as specified in the Offer. + Sku sku = 11; + + // Optional. The customer to transfer has an entitlement with the populated legacy SKU. + Sku legacy_sku = 12 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies transfer eligibility of a SKU. +message TransferEligibility { + // Reason of ineligibility. + enum Reason { + // Not used. + REASON_UNSPECIFIED = 0; + + // Reseller needs to accept TOS before transferring the SKU. + PENDING_TOS_ACCEPTANCE = 1; + + // Reseller not eligible to sell the SKU. + SKU_NOT_ELIGIBLE = 2; + + // SKU subscription is suspended + SKU_SUSPENDED = 3; + } + + // Whether reseller is eligible to transfer the SKU. + bool is_eligible = 1; + + // Localized description if reseller is not eligible to transfer the SKU. + string description = 2; + + // Specified the reason for ineligibility. + Reason ineligibility_reason = 3; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto new file mode 100644 index 00000000000..ebe698e1f54 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto @@ -0,0 +1,329 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/cloud/channel/v1/products.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/money.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "OffersProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Constraints type for Promotional offers. +enum PromotionalOrderType { + // Not used. + PROMOTIONAL_TYPE_UNSPECIFIED = 0; + + // Order used for new customers, trial conversions and upgrades. + NEW_UPGRADE = 1; + + // All orders for transferring an existing customer. + TRANSFER = 2; + + // Orders for modifying an existing customer's promotion on the same SKU. + PROMOTION_SWITCH = 3; +} + +// Describes how the reseller will be billed. +enum PaymentPlan { + // Not used. + PAYMENT_PLAN_UNSPECIFIED = 0; + + // Commitment. + COMMITMENT = 1; + + // No commitment. + FLEXIBLE = 2; + + // Free. + FREE = 3; + + // Trial. + TRIAL = 4; + + // Price and ordering not available through API. + OFFLINE = 5; +} + +// Specifies when the payment needs to happen. +enum PaymentType { + // Not used. + PAYMENT_TYPE_UNSPECIFIED = 0; + + // Prepay. Amount has to be paid before service is rendered. + PREPAY = 1; + + // Postpay. Reseller is charged at the end of the Payment cycle. + POSTPAY = 2; +} + +// Represents the type for a monetizable resource(any entity on which billing +// happens). For example, this could be MINUTES for Google Voice and GB for +// Google Drive. One SKU can map to multiple monetizable resources. +enum ResourceType { + // Not used. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Seat. + SEAT = 1; + + // Monthly active user. + MAU = 2; + + // GB (used for storage SKUs). + GB = 3; + + // Active licensed users(for Voice SKUs). + LICENSED_USER = 4; + + // Voice usage. + MINUTES = 5; + + // For IaaS SKUs like Google Cloud Platform, monetization is based on usage + // accrued on your billing account irrespective of the type of monetizable + // resource. This enum represents an aggregated resource/container for all + // usage SKUs on a billing account. Currently, only applicable to Google Cloud + // Platform. + IAAS_USAGE = 6; + + // For Google Cloud Platform subscriptions like Anthos or SAP. + SUBSCRIPTION = 7; +} + +// Period Type. +enum PeriodType { + // Not used. + PERIOD_TYPE_UNSPECIFIED = 0; + + // Day. + DAY = 1; + + // Month. + MONTH = 2; + + // Year. + YEAR = 3; +} + +// Represents an offer made to resellers for purchase. +// An offer is associated with a [Sku][google.cloud.channel.v1.Sku], has a plan for payment, a price, and +// defines the constraints for buying. +message Offer { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Offer" + pattern: "accounts/{account}/offers/{offer}" + }; + + // Resource Name of the Offer. + // Format: accounts/{account_id}/offers/{offer_id} + string name = 1; + + // Marketing information for the Offer. + MarketingInfo marketing_info = 2; + + // SKU the offer is associated with. + Sku sku = 3; + + // Describes the payment plan for the Offer. + Plan plan = 4; + + // Constraints on transacting the Offer. + Constraints constraints = 5; + + // Price for each monetizable resource type. + repeated PriceByResource price_by_resources = 6; + + // Start of the Offer validity time. + google.protobuf.Timestamp start_time = 7; + + // Output only. End of the Offer validity time. + google.protobuf.Timestamp end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Parameters required to use current Offer to purchase. + repeated ParameterDefinition parameter_definitions = 9; + + // The deal code of the offer to get a special promotion or discount. + string deal_code = 12; +} + +// Parameter's definition. Specifies what parameter is required to use the +// current Offer to purchase. +message ParameterDefinition { + // Data type of the parameter. + enum ParameterType { + // Not used. + PARAMETER_TYPE_UNSPECIFIED = 0; + + // Int64 type. + INT64 = 1; + + // String type. + STRING = 2; + + // Double type. + DOUBLE = 3; + } + + // Name of the parameter. + string name = 1; + + // Data type of the parameter. Minimal value, Maximum value and allowed values + // will use specified data type here. + ParameterType parameter_type = 2; + + // Minimal value of the parameter, if applicable. Inclusive. For example, + // minimal commitment when purchasing Anthos is 0.01. + // Applicable to INT64 and DOUBLE parameter types. + Value min_value = 3; + + // Maximum value of the parameter, if applicable. Inclusive. For example, + // maximum seats when purchasing Google Workspace Business Standard. + // Applicable to INT64 and DOUBLE parameter types. + Value max_value = 4; + + // If not empty, parameter values must be drawn from this list. + // For example, [us-west1, us-west2, ...] + // Applicable to STRING parameter type. + repeated Value allowed_values = 5; + + // If set to true, parameter is optional to purchase this Offer. + bool optional = 6; +} + +// Represents the constraints for buying the Offer. +message Constraints { + // Represents constraints required to purchase the Offer for a customer. + CustomerConstraints customer_constraints = 1; +} + +// Represents constraints required to purchase the Offer for a customer. +message CustomerConstraints { + // Allowed geographical regions of the customer. + repeated string allowed_regions = 1; + + // Allowed Customer Type. + repeated CloudIdentityInfo.CustomerType allowed_customer_types = 2; + + // Allowed Promotional Order Type. Present for Promotional offers. + repeated PromotionalOrderType promotional_order_types = 3; +} + +// The payment plan for the Offer. Describes how to make a payment. +message Plan { + // Describes how a reseller will be billed. + PaymentPlan payment_plan = 1; + + // Specifies when the payment needs to happen. + PaymentType payment_type = 2; + + // Describes how frequently the reseller will be billed, such as + // once per month. + Period payment_cycle = 3; + + // Present for Offers with a trial period. + // For trial-only Offers, a paid service needs to start before the trial + // period ends for continued service. + // For Regular Offers with a trial period, the regular pricing goes into + // effect when trial period ends, or if paid service is started before the end + // of the trial period. + Period trial_period = 4; + + // Reseller Billing account to charge after an offer transaction. + // Only present for Google Cloud Platform offers. + string billing_account = 5; +} + +// Represents price by resource type. +message PriceByResource { + // Resource Type. Example: SEAT + ResourceType resource_type = 1; + + // Price of the Offer. Present if there are no price phases. + Price price = 2; + + // Specifies the price by time range. + repeated PricePhase price_phases = 3; +} + +// Represents the price of the Offer. +message Price { + // Base price. + google.type.Money base_price = 1; + + // Discount percentage, represented as decimal. + // For example, a 20% discount will be represent as 0.2. + double discount = 2; + + // Effective Price after applying the discounts. + google.type.Money effective_price = 3; + + // Link to external price list, such as link to Google Voice rate card. + string external_price_uri = 4; +} + +// Specifies the price by the duration of months. +// For example, a 20% discount for the first six months, then a 10% discount +// starting on the seventh month. +message PricePhase { + // Defines the phase period type. + PeriodType period_type = 1; + + // Defines first period for the phase. + int32 first_period = 2; + + // Defines first period for the phase. + int32 last_period = 3; + + // Price of the phase. Present if there are no price tiers. + Price price = 4; + + // Price by the resource tiers. + repeated PriceTier price_tiers = 5; +} + +// Defines price at resource tier level. +// For example, an offer with following definition : +// +// * Tier 1: Provide 25% discount for all seats between 1 and 25. +// * Tier 2: Provide 10% discount for all seats between 26 and 100. +// * Tier 3: Provide flat 15% discount for all seats above 100. +// +// Each of these tiers is represented as a PriceTier. +message PriceTier { + // First resource for which the tier price applies. + int32 first_resource = 1; + + // Last resource for which the tier price applies. + int32 last_resource = 2; + + // Price of the tier. + Price price = 3; +} + +// Represents period in days/months/years. +message Period { + // Total duration of Period Type defined. + int32 duration = 1; + + // Period Type. + PeriodType period_type = 2; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto new file mode 100644 index 00000000000..ad432919bf7 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.channel.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "OperationsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Provides contextual information about a [google.longrunning.Operation][google.longrunning.Operation]. +message OperationMetadata { + // RPCs that return a Long Running Operation. + enum OperationType { + // Not used. + OPERATION_TYPE_UNSPECIFIED = 0; + + // Long Running Operation was triggered by CreateEntitlement. + CREATE_ENTITLEMENT = 1; + + // Long Running Operation was triggered by ChangeRenewalSettings. + CHANGE_RENEWAL_SETTINGS = 3; + + // Long Running Operation was triggered by StartPaidService. + START_PAID_SERVICE = 5; + + // Long Running Operation was triggered by ActivateEntitlement. + ACTIVATE_ENTITLEMENT = 7; + + // Long Running Operation was triggered by SuspendEntitlement. + SUSPEND_ENTITLEMENT = 8; + + // Long Running Operation was triggered by CancelEntitlement. + CANCEL_ENTITLEMENT = 9; + + // Long Running Operation was triggered by TransferEntitlements. + TRANSFER_ENTITLEMENTS = 10; + + // Long Running Operation was triggered by TransferEntitlementsToGoogle. + TRANSFER_ENTITLEMENTS_TO_GOOGLE = 11; + + // Long Running Operation was triggered by ChangeOffer. + CHANGE_OFFER = 14; + + // Long Running Operation was triggered by ChangeParameters. + CHANGE_PARAMETERS = 15; + + // Long Running Operation was triggered by ProvisionCloudIdentity. + PROVISION_CLOUD_IDENTITY = 16; + } + + // The RPC that initiated this Long Running Operation. + OperationType operation_type = 1; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto new file mode 100644 index 00000000000..8dc39767a96 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto @@ -0,0 +1,94 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.channel.v1; + +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ProductsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Type of media used. +enum MediaType { + // Not used. + MEDIA_TYPE_UNSPECIFIED = 0; + + // Type of image. + MEDIA_TYPE_IMAGE = 1; +} + +// A Product is the entity a customer uses when placing an order. For example, +// Google Workspace, Google Voice, etc. +message Product { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Product" + pattern: "products/{product}" + }; + + // Resource Name of the Product. + // Format: products/{product_id} + string name = 1; + + // Marketing information for the product. + MarketingInfo marketing_info = 2; +} + +// Represents a product's purchasable Stock Keeping Unit (SKU). +// SKUs represent the different variations of the product. For example, Google +// Workspace Business Standard and Google Workspace Business Plus are Google +// Workspace product SKUs. +message Sku { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Sku" + pattern: "products/{product}/skus/{sku}" + }; + + // Resource Name of the SKU. + // Format: products/{product_id}/skus/{sku_id} + string name = 1; + + // Marketing information for the SKU. + MarketingInfo marketing_info = 2; + + // Product the SKU is associated with. + Product product = 3; +} + +// Represents the marketing information for a Product, SKU or Offer. +message MarketingInfo { + // Human readable name. + string display_name = 1; + + // Human readable description. Description can contain HTML. + string description = 2; + + // Default logo. + Media default_logo = 3; +} + +// Represents media information. +message Media { + // Title of the media. + string title = 1; + + // URL of the media. + string content = 2; + + // Type of the media. + MediaType type = 3; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto new file mode 100644 index 00000000000..464061766cf --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto @@ -0,0 +1,425 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; +import "google/type/datetime.proto"; +import "google/type/decimal.proto"; +import "google/type/money.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ReportsServiceProto"; +option java_package = "com.google.cloud.channel.v1"; + +// CloudChannelReportsService lets Google Cloud resellers and +// distributors retrieve and combine a variety of data in Cloud Channel for +// multiple products (Google Cloud Platform (GCP), Google Voice, and +// Google Workspace.) +service CloudChannelReportsService { + option (google.api.default_host) = "cloudchannel.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/apps.reports.usage.readonly"; + + // Begins generation of data for a given report. The report + // identifier is a UID (for example, `613bf59q`). + // + // Possible error codes: + // + // * PERMISSION_DENIED: The user doesn't have access to this report. + // * INVALID_ARGUMENT: Required request parameters are missing + // or invalid. + // * NOT_FOUND: The report identifier was not found. + // * INTERNAL: Any non-user error related to a technical issue + // in the backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue + // in the backend. Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata contains an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + // + // To get the results of report generation, call + // [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults] with the + // [RunReportJobResponse.report_job][google.cloud.channel.v1.RunReportJobResponse.report_job]. + rpc RunReportJob(RunReportJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/reports/*}:run" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "RunReportJobResponse" + metadata_type: "OperationMetadata" + }; + } + + // Retrieves data generated by [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. + rpc FetchReportResults(FetchReportResultsRequest) returns (FetchReportResultsResponse) { + option (google.api.http) = { + post: "/v1/{report_job=accounts/*/reportJobs/*}:fetchReportResults" + body: "*" + }; + option (google.api.method_signature) = "report_job"; + } + + // Lists the reports that RunReportJob can run. These reports include an ID, + // a description, and the list of columns that will be in the result. + rpc ListReports(ListReportsRequest) returns (ListReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. +message RunReportJobRequest { + // Required. The report's resource name. Specifies the account and report used to + // generate report data. The report_id identifier is a UID (for example, + // `613bf59q`). + // Name uses the format: + // accounts/{account_id}/reports/{report_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Report" + } + ]; + + // Optional. The range of usage or invoice dates to include in the result. + DateRange date_range = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A structured string that defines conditions on dimension columns to + // restrict the report output. + // + // Filters support logical operators (AND, OR, NOT) and conditional operators + // (=, !=, <, >, <=, and >=) using `column_id` as keys. + // + // For example: + // `(customer:"accounts/C123abc/customers/S456def" OR + // customer:"accounts/C123abc/customers/S789ghi") AND + // invoice_start_date.year >= 2022` + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US". If specified, the + // response is localized to the corresponding language code if the + // original data sources support it. + // Default is "en-US". + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. +message RunReportJobResponse { + // Pass `report_job.name` to [FetchReportResultsRequest.report_job][google.cloud.channel.v1.FetchReportResultsRequest.report_job] + // to retrieve the report's results. + ReportJob report_job = 1; + + // The metadata for the report's results (display name, columns, row count, + // and date range). If you view this before the operation finishes, + // you may see incomplete data. + ReportResultsMetadata report_metadata = 2; +} + +// Request message for [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. +message FetchReportResultsRequest { + // Required. The report job created by [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. + // Report_job uses the format: + // accounts/{account_id}/reportJobs/{report_job_id} + string report_job = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/ReportJob" + } + ]; + + // Optional. Requested page size of the report. The server may return fewer results than + // requested. If you don't specify a page size, the server uses a sensible + // default (may change over time). + // + // The maximum value is 30,000; the server will change larger values to + // 30,000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token that specifies a page of results beyond the first page. + // Obtained through + // [FetchReportResultsResponse.next_page_token][google.cloud.channel.v1.FetchReportResultsResponse.next_page_token] of the previous + // [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. +// Contains a tabular representation of the report results. +message FetchReportResultsResponse { + // The metadata for the report results (display name, columns, row count, and + // date ranges). + ReportResultsMetadata report_metadata = 1; + + // The report's lists of values. Each row follows the settings and ordering + // of the columns from `report_metadata`. + repeated Row rows = 2; + + // Pass this token to [FetchReportResultsRequest.page_token][google.cloud.channel.v1.FetchReportResultsRequest.page_token] to retrieve + // the next page of results. + string next_page_token = 3; +} + +// Request message for [CloudChannelReportsService.ListReports][google.cloud.channel.v1.CloudChannelReportsService.ListReports]. +message ListReportsRequest { + // Required. The resource name of the partner account to list available reports for. + // Parent uses the format: + // accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size of the report. The server might return fewer results + // than requested. If unspecified, returns 20 reports. + // The maximum value is 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token that specifies a page of results beyond the first page. + // Obtained through + // [ListReportsResponse.next_page_token][google.cloud.channel.v1.ListReportsResponse.next_page_token] of the previous + // [CloudChannelReportsService.ListReports][google.cloud.channel.v1.CloudChannelReportsService.ListReports] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code, such as "en-US". If specified, the + // response is localized to the corresponding language code if the + // original data sources support it. + // Default is "en-US". + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelReportsService.ListReports][google.cloud.channel.v1.CloudChannelReportsService.ListReports]. +message ListReportsResponse { + // The reports available to the partner. + repeated Report reports = 1; + + // Pass this token to [FetchReportResultsRequest.page_token][google.cloud.channel.v1.FetchReportResultsRequest.page_token] to retrieve + // the next page of results. + string next_page_token = 2; +} + +// The result of a [RunReportJob][] operation. Contains the name to use in +// [FetchReportResultsRequest.report_job][google.cloud.channel.v1.FetchReportResultsRequest.report_job] and the status of the operation. +message ReportJob { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/ReportJob" + pattern: "accounts/{account}/reportJobs/{report_job}" + }; + + // Required. The resource name of a report job. + // Name uses the format: + // `accounts/{account_id}/reportJobs/{report_job_id}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The current status of report generation. + ReportStatus report_status = 2; +} + +// The features describing the data. Returned by +// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob] and +// [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. +message ReportResultsMetadata { + // Details of the completed report. + Report report = 1; + + // The total number of rows of data in the final report. + int64 row_count = 2; + + // The date range of reported usage. + DateRange date_range = 3; + + // The usage dates immediately preceding `date_range` with the same duration. + // Use this to calculate trending usage and costs. This is only populated if + // you request trending data. + // + // For example, if `date_range` is July 1-15, `preceding_date_range` will be + // June 16-30. + DateRange preceding_date_range = 4; +} + +// The definition of a report column. Specifies the data properties +// in the corresponding position of the report rows. +message Column { + // Available data types for columns. Corresponds to the fields in the + // ReportValue `oneof` field. + enum DataType { + // Not used. + DATA_TYPE_UNSPECIFIED = 0; + + // ReportValues for this column will use string_value. + STRING = 1; + + // ReportValues for this column will use int_value. + INT = 2; + + // ReportValues for this column will use decimal_value. + DECIMAL = 3; + + // ReportValues for this column will use money_value. + MONEY = 4; + + // ReportValues for this column will use date_value. + DATE = 5; + + // ReportValues for this column will use date_time_value. + DATE_TIME = 6; + } + + // The unique name of the column (for example, customer_domain, + // channel_partner, customer_cost). You can use column IDs in + // [RunReportJobRequest.filter][google.cloud.channel.v1.RunReportJobRequest.filter]. + // To see all reports and their columns, call + // [CloudChannelReportsService.ListReports][google.cloud.channel.v1.CloudChannelReportsService.ListReports]. + string column_id = 1; + + // The column's display name. + string display_name = 2; + + // The type of the values for this column. + DataType data_type = 3; +} + +// A representation of usage or invoice date ranges. +message DateRange { + // The earliest usage date time (inclusive). + // + // If you use time groupings (daily, weekly, etc), each group uses + // midnight to midnight (Pacific time). The usage start date is + // rounded down to include all usage from the specified date. We recommend + // that clients pass `usage_start_date_time` in Pacific time. + google.type.DateTime usage_start_date_time = 1; + + // The latest usage date time (exclusive). + // + // If you use time groupings (daily, weekly, etc), each group uses + // midnight to midnight (Pacific time). The usage end date is + // rounded down to include all usage from the specified date. We recommend + // that clients pass `usage_start_date_time` in Pacific time. + google.type.DateTime usage_end_date_time = 2; + + // The earliest invoice date (inclusive). + // + // If your product uses monthly invoices, and this value is not the beginning + // of a month, this will adjust the date to the first day of the given month. + google.type.Date invoice_start_date = 3; + + // The latest invoice date (exclusive). + // + // If your product uses monthly invoices, and this value is not the beginning + // of a month, this will adjust the date to the first day of the following + // month. + google.type.Date invoice_end_date = 4; +} + +// A row of report values. +message Row { + // The list of values in the row. + repeated ReportValue values = 1; +} + +// A single report value. +message ReportValue { + // A single report value. + oneof value { + // A value of type `string`. + string string_value = 1; + + // A value of type `int`. + int64 int_value = 2; + + // A value of type `google.type.Decimal`, representing non-integer numeric + // values. + google.type.Decimal decimal_value = 3; + + // A value of type `google.type.Money` (currency code, whole units, decimal + // units). + google.type.Money money_value = 4; + + // A value of type `google.type.Date` (year, month, day). + google.type.Date date_value = 5; + + // A value of type `google.type.DateTime` (year, month, day, hour, minute, + // second, and UTC offset or timezone.) + google.type.DateTime date_time_value = 6; + } +} + +// Status of a report generation process. +message ReportStatus { + // Available states of report generation. + enum State { + // Not used. + STATE_UNSPECIFIED = 0; + + // Report processing started. + STARTED = 1; + + // Data generated from the report is being staged. + WRITING = 2; + + // Report data is available for access. + AVAILABLE = 3; + + // Report failed. + FAILED = 4; + } + + // The current state of the report generation process. + State state = 1; + + // The report generation's start time. + google.protobuf.Timestamp start_time = 2; + + // The report generation's completion time. + google.protobuf.Timestamp end_time = 3; +} + +// The ID and description of a report that was used to generate report data. +// For example, "GCP Daily Spend", "Google Workspace License Activity", etc. +message Report { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/Report" + pattern: "accounts/{account}/reports/{report}" + }; + + // Required. The report's resource name. Specifies the account and report used to + // generate report data. The report_id identifier is a UID + // (for example, `613bf59q`). + // + // Name uses the format: + // accounts/{account_id}/reports/{report_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // A human-readable name for this report. + string display_name = 2; + + // The list of columns included in the report. This defines the schema of + // the report results. + repeated Column columns = 3; + + // A description of other aspects of the report, such as the products + // it supports. + string description = 4; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto new file mode 100644 index 00000000000..7cc2f26072c --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto @@ -0,0 +1,149 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; +import "google/type/decimal.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "RepricingProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Specifies the different costs that the modified bill can be based on. +enum RebillingBasis { + // Not used. + REBILLING_BASIS_UNSPECIFIED = 0; + + // Use the list cost, also known as the MSRP. + COST_AT_LIST = 1; + + // Pass through all discounts except the Reseller Program Discount. If this is + // the default cost base and no adjustments are specified, the output cost + // will be exactly what the customer would see if they viewed the bill in the + // Google Cloud Console. + DIRECT_CUSTOMER_COST = 2; +} + +// Configuration for how a reseller will reprice a Customer. +message CustomerRepricingConfig { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/CustomerRepricingConfig" + pattern: "accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}" + }; + + // Output only. Resource name of the CustomerRepricingConfig. + // Format: + // accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The configuration for bill modifications made by a reseller before + // sending it to customers. + RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp of an update to the repricing rule. If `update_time` is after + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] then it indicates this was set + // mid-month. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for how a distributor will rebill a channel partner +// (also known as a distributor-authorized reseller). +message ChannelPartnerRepricingConfig { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig" + pattern: "accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}" + }; + + // Output only. Resource name of the ChannelPartnerRepricingConfig. + // Format: + // accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The configuration for bill modifications made by a reseller before + // sending it to ChannelPartner. + RepricingConfig repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp of an update to the repricing rule. If `update_time` is after + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] then it indicates this was set + // mid-month. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for repricing a Google bill over a period of time. +message RepricingConfig { + // Applies the repricing configuration at the entitlement level. + message EntitlementGranularity { + // Resource name of the entitlement. + // Format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [(google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + }]; + } + + // Applies the repricing configuration at the channel partner level. + // The channel partner value is derived from the resource name. Takes an + // empty json object. + message ChannelPartnerGranularity { + + } + + // Required. Defines the granularity for repricing. + oneof granularity { + // Applies the repricing configuration at the entitlement level. This is + // the only supported value for CustomerRepricingConfig. + EntitlementGranularity entitlement_granularity = 4; + + // Applies the repricing configuration at the channel partner level. + // This is the only supported value for ChannelPartnerRepricingConfig. + ChannelPartnerGranularity channel_partner_granularity = 5; + } + + // Required. The YearMonth when these adjustments activate. The Day field needs to be + // "0" since we only accept YearMonth repricing boundaries. + google.type.Date effective_invoice_month = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Information about the adjustment. + RepricingAdjustment adjustment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to use for this bill. Specifies the relative cost + // based on repricing costs you will apply. + RebillingBasis rebilling_basis = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A type that represents the various adjustments you can apply to a bill. +message RepricingAdjustment { + // A oneof that represents the different types for this adjustment. + oneof adjustment { + // Flat markup or markdown on an entire bill. + PercentageAdjustment percentage_adjustment = 2; + } +} + +// An adjustment that applies a flat markup or markdown to an entire bill. +message PercentageAdjustment { + // The percentage of the bill to adjust. + // For example: + // Mark down by 1% => "-1.00" + // Mark up by 1% => "1.00" + // Pass-Through => "0.00" + google.type.Decimal percentage = 2; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto new file mode 100644 index 00000000000..bbb092e181f --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto @@ -0,0 +1,2452 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/channel/v1/channel_partner_links.proto"; +import "google/cloud/channel/v1/common.proto"; +import "google/cloud/channel/v1/customers.proto"; +import "google/cloud/channel/v1/entitlements.proto"; +import "google/cloud/channel/v1/offers.proto"; +import "google/cloud/channel/v1/products.proto"; +import "google/cloud/channel/v1/repricing.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.channel.v1"; + +// CloudChannelService lets Google cloud resellers and distributors manage +// their customers, channel partners, entitlements, and reports. +// +// Using this service: +// 1. Resellers and distributors can manage a customer entity. +// 2. Distributors can register an authorized reseller in their channel and +// provide them with delegated admin access. +// 3. Resellers and distributors can manage customer entitlements. +// +// CloudChannelService exposes the following resources: +// - [Customer][google.cloud.channel.v1.Customer]s: An entity—usually an enterprise—managed by a reseller or +// distributor. +// +// - [Entitlement][google.cloud.channel.v1.Entitlement]s: An entity that provides a customer with the means to use +// a service. Entitlements are created or updated as a result of a successful +// fulfillment. +// +// - [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s: An entity that identifies links between +// distributors and their indirect resellers in a channel. +service CloudChannelService { + option (google.api.default_host) = "cloudchannel.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/apps.order"; + + // List [Customer][google.cloud.channel.v1.Customer]s. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // + // Return value: + // List of [Customer][google.cloud.channel.v1.Customer]s, or an empty list if there are no customers. + rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/customers" + additional_bindings { + get: "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers" + } + }; + } + + // Returns the requested [Customer][google.cloud.channel.v1.Customer] resource. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The customer resource doesn't exist. Usually the result of an + // invalid name parameter. + // + // Return value: + // The [Customer][google.cloud.channel.v1.Customer] resource. + rpc GetCustomer(GetCustomerRequest) returns (Customer) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/customers/*}" + additional_bindings { + get: "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Confirms the existence of Cloud Identity accounts based on the domain and + // if the Cloud Identity accounts are owned by the reseller. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * INVALID_VALUE: Invalid domain value in the request. + // + // Return value: + // A list of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources for the domain (may be + // empty) + // + // Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if + // no [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources match the domain. + rpc CheckCloudIdentityAccountsExist(CheckCloudIdentityAccountsExistRequest) returns (CheckCloudIdentityAccountsExistResponse) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}:checkCloudIdentityAccountsExist" + body: "*" + }; + } + + // Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor + // account. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: + // * Required request parameters are missing or invalid. + // * Domain field value doesn't match the primary email domain. + // + // Return value: + // The newly created [Customer][google.cloud.channel.v1.Customer] resource. + rpc CreateCustomer(CreateCustomerRequest) returns (Customer) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/customers" + body: "customer" + additional_bindings { + post: "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers" + body: "customer" + } + }; + } + + // Updates an existing [Customer][google.cloud.channel.v1.Customer] resource for the reseller or + // distributor. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name in the request. + // + // Return value: + // The updated [Customer][google.cloud.channel.v1.Customer] resource. + rpc UpdateCustomer(UpdateCustomerRequest) returns (Customer) { + option (google.api.http) = { + patch: "/v1/{customer.name=accounts/*/customers/*}" + body: "customer" + additional_bindings { + patch: "/v1/{customer.name=accounts/*/channelPartnerLinks/*/customers/*}" + body: "customer" + } + }; + } + + // Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The account making the request does not own + // this customer. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * FAILED_PRECONDITION: The customer has existing entitlements. + // * NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name in the request. + rpc DeleteCustomer(DeleteCustomerRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accounts/*/customers/*}" + additional_bindings { + delete: "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with the provided + // Cloud Identity ID or domain before a TransferEntitlements call. If a + // linked Customer already exists and overwrite_if_exists is true, it will + // update that Customer's data. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * NOT_FOUND: Cloud Identity doesn't exist or was deleted. + // * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is + // expired or invalid. + // * ALREADY_EXISTS: A customer already exists and has conflicting critical + // fields. Requires an overwrite. + // + // Return value: + // The [Customer][google.cloud.channel.v1.Customer]. + rpc ImportCustomer(ImportCustomerRequest) returns (Customer) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/customers:import" + body: "*" + additional_bindings { + post: "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers:import" + body: "*" + } + }; + } + + // Creates a Cloud Identity for the given customer using the customer's + // information, or the information provided here. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The customer was not found. + // * ALREADY_EXISTS: The customer's primary email already exists. Retry + // after changing the customer's primary contact email. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata contains an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ProvisionCloudIdentity(ProvisionCloudIdentityRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{customer=accounts/*/customers/*}:provisionCloudIdentity" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Customer" + metadata_type: "OperationMetadata" + }; + } + + // Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // + // Return value: + // A list of the customer's [Entitlement][google.cloud.channel.v1.Entitlement]s. + rpc ListEntitlements(ListEntitlementsRequest) returns (ListEntitlementsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*/customers/*}/entitlements" + }; + } + + // List [TransferableSku][google.cloud.channel.v1.TransferableSku]s of a customer based on the Cloud Identity ID or + // Customer Name in the request. + // + // Use this method to list the entitlements information of an + // unowned customer. You should provide the customer's + // Cloud Identity ID or Customer Name. + // + // Possible error codes: + // + // * PERMISSION_DENIED: + // * The customer doesn't belong to the reseller and has no auth token. + // * The supplied auth token is invalid. + // * The reseller account making the request is different + // from the reseller account in the query. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // + // Return value: + // A list of the customer's [TransferableSku][google.cloud.channel.v1.TransferableSku]. + rpc ListTransferableSkus(ListTransferableSkusRequest) returns (ListTransferableSkusResponse) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}:listTransferableSkus" + body: "*" + }; + } + + // List [TransferableOffer][google.cloud.channel.v1.TransferableOffer]s of a customer based on Cloud Identity ID or + // Customer Name in the request. + // + // Use this method when a reseller gets the entitlement information of an + // unowned customer. The reseller should provide the customer's + // Cloud Identity ID or Customer Name. + // + // Possible error codes: + // + // * PERMISSION_DENIED: + // * The customer doesn't belong to the reseller and has no auth token. + // * The customer provided incorrect reseller information when generating + // auth token. + // * The reseller account making the request is different + // from the reseller account in the query. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // + // Return value: + // List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. + rpc ListTransferableOffers(ListTransferableOffersRequest) returns (ListTransferableOffersResponse) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}:listTransferableOffers" + body: "*" + }; + } + + // Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The customer entitlement was not found. + // + // Return value: + // The requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. + rpc GetEntitlement(GetEntitlementRequest) returns (Entitlement) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/customers/*/entitlements/*}" + }; + } + + // Creates an entitlement for a customer. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: + // * Required request parameters are missing or invalid. + // * There is already a customer entitlement for a SKU from the same + // product family. + // * INVALID_VALUE: Make sure the OfferId is valid. If it is, contact + // Google Channel support for further troubleshooting. + // * NOT_FOUND: The customer or offer resource was not found. + // * ALREADY_EXISTS: + // * The SKU was already purchased for the customer. + // * The customer's primary email already exists. Retry + // after changing the customer's primary contact email. + // * CONDITION_NOT_MET or FAILED_PRECONDITION: + // * The domain required for purchasing a SKU has not been verified. + // * A pre-requisite SKU required to purchase an Add-On SKU is missing. + // For example, Google Workspace Business Starter is required to purchase + // Vault or Drive. + // * (Developer accounts only) Reseller and resold domain must meet the + // following naming requirements: + // * Domain names must start with goog-test. + // * Domain names must include the reseller domain. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc CreateEntitlement(CreateEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}/entitlements" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Change parameters of the entitlement. + // + // An entitlement update is a long-running operation and it updates the + // entitlement as a result of fulfillment. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // For example, the number of seats being changed is greater than the allowed + // number of max seats, or decreasing seats for a commitment based plan. + // * NOT_FOUND: Entitlement resource not found. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ChangeParameters(ChangeParametersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeParameters" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Updates the renewal settings for an existing customer entitlement. + // + // An entitlement update is a long-running operation and it updates the + // entitlement as a result of fulfillment. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Entitlement resource not found. + // * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a + // commitment plan. Can't enable or disable renewals for non-commitment plans. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ChangeRenewalSettings(ChangeRenewalSettingsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeRenewalSettings" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Updates the Offer for an existing customer entitlement. + // + // An entitlement update is a long-running operation and it updates the + // entitlement as a result of fulfillment. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Offer or Entitlement resource not found. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ChangeOffer(ChangeOfferRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeOffer" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Starts paid service for a trial entitlement. + // + // Starts paid service for a trial entitlement immediately. This method is + // only applicable if a plan is set up for a trial entitlement but has some + // trial days remaining. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Entitlement resource not found. + // * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for + // entitlement on trial plans. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc StartPaidService(StartPaidServiceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:startPaidService" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Suspends a previously fulfilled entitlement. + // + // An entitlement suspension is a long-running operation. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Entitlement resource not found. + // * NOT_ACTIVE: Entitlement is not active. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc SuspendEntitlement(SuspendEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:suspend" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Cancels a previously fulfilled entitlement. + // + // An entitlement cancellation is a long-running operation. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * FAILED_PRECONDITION: There are Google Cloud projects linked to the + // Google Cloud entitlement's Cloud Billing subaccount. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Entitlement resource not found. + // * DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace + // add-ons, or entitlements for Google Cloud's development platform. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The response will contain + // google.protobuf.Empty on success. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc CancelEntitlement(CancelEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:cancel" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Activates a previously suspended entitlement. Entitlements suspended for + // pending ToS acceptance can't be activated using this method. + // + // An entitlement activation is a long-running operation and it updates + // the state of the customer entitlement. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Entitlement resource not found. + // * SUSPENSION_NOT_RESELLER_INITIATED: Can only activate reseller-initiated + // suspensions and entitlements that have accepted the TOS. + // * NOT_SUSPENDED: Can only activate suspended entitlements not in an ACTIVE + // state. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc ActivateEntitlement(ActivateEntitlementRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=accounts/*/customers/*/entitlements/*}:activate" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Entitlement" + metadata_type: "OperationMetadata" + }; + } + + // Transfers customer entitlements to new reseller. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The customer or offer resource was not found. + // * ALREADY_EXISTS: The SKU was already transferred for the customer. + // * CONDITION_NOT_MET or FAILED_PRECONDITION: + // * The SKU requires domain verification to transfer, but the domain is + // not verified. + // * An Add-On SKU (example, Vault or Drive) is missing the + // pre-requisite SKU (example, G Suite Basic). + // * (Developer accounts only) Reseller and resold domain must meet the + // following naming requirements: + // * Domain names must start with goog-test. + // * Domain names must include the reseller domain. + // * Specify all transferring entitlements. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc TransferEntitlements(TransferEntitlementsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}:transferEntitlements" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "TransferEntitlementsResponse" + metadata_type: "OperationMetadata" + }; + } + + // Transfers customer entitlements from their current reseller to Google. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The customer or offer resource was not found. + // * ALREADY_EXISTS: The SKU was already transferred for the customer. + // * CONDITION_NOT_MET or FAILED_PRECONDITION: + // * The SKU requires domain verification to transfer, but the domain is + // not verified. + // * An Add-On SKU (example, Vault or Drive) is missing the + // pre-requisite SKU (example, G Suite Basic). + // * (Developer accounts only) Reseller and resold domain must meet the + // following naming requirements: + // * Domain names must start with goog-test. + // * Domain names must include the reseller domain. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The ID of a long-running operation. + // + // To get the results of the operation, call the GetOperation method of + // CloudChannelOperationsService. The response will contain + // google.protobuf.Empty on success. The Operation metadata will contain an + // instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + rpc TransferEntitlementsToGoogle(TransferEntitlementsToGoogleRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}:transferEntitlementsToGoogle" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s belonging to a distributor. + // You must be a distributor to call this method. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // + // Return value: + // The list of the distributor account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resources. + rpc ListChannelPartnerLinks(ListChannelPartnerLinksRequest) returns (ListChannelPartnerLinksResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/channelPartnerLinks" + }; + } + + // Returns the requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + // You must be a distributor to call this method. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: ChannelPartnerLink resource not found because of an + // invalid channel partner link name. + // + // Return value: + // The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + rpc GetChannelPartnerLink(GetChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/channelPartnerLinks/*}" + }; + } + + // Initiates a channel partner link between a distributor and a reseller, or + // between resellers in an n-tier reseller channel. + // Invited partners need to follow the invite_link_uri provided in the + // response to accept. After accepting the invitation, a link is set up + // between the two parties. + // You must be a distributor to call this method. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * ALREADY_EXISTS: The ChannelPartnerLink sent in the request already + // exists. + // * NOT_FOUND: No Cloud Identity customer exists for provided domain. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + rpc CreateChannelPartnerLink(CreateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/channelPartnerLinks" + body: "channel_partner_link" + }; + } + + // Updates a channel partner link. Distributors call this method to change a + // link's status. For example, to suspend a partner link. + // You must be a distributor to call this method. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request is different + // from the reseller account in the API request. + // * INVALID_ARGUMENT: + // * Required request parameters are missing or invalid. + // * Link state cannot change from invited to active or suspended. + // * Cannot send reseller_cloud_identity_id, invite_url, or name in update + // mask. + // * NOT_FOUND: ChannelPartnerLink resource not found. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + rpc UpdateChannelPartnerLink(UpdateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + option (google.api.http) = { + patch: "/v1/{name=accounts/*/channelPartnerLinks/*}" + body: "*" + }; + } + + // Gets information about how a Reseller modifies their bill before sending + // it to a Customer. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] was not found. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise returns + // an error. + rpc GetCustomerRepricingConfig(GetCustomerRepricingConfigRequest) returns (CustomerRepricingConfig) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/customers/*/customerRepricingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about how a Reseller modifies their bill before sending + // it to a Customer. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is + // not associated with the given account. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resources. The + // data for each resource is displayed in the ascending order of: + // * customer ID + // * [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement] + // * [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] + // * [CustomerRepricingConfig.update_time][google.cloud.channel.v1.CustomerRepricingConfig.update_time] + // + // If unsuccessful, returns an error. + rpc ListCustomerRepricingConfigs(ListCustomerRepricingConfigsRequest) returns (ListCustomerRepricingConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a CustomerRepricingConfig. Call this method to set modifications + // for a specific customer's bill. You can only create configs if the + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a + // future month. If needed, you can create a config for the current month, + // with some restrictions. + // + // When creating a config for a future month, make sure there are no existing + // configs for that + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. + // + // The following restrictions are for creating configs in the current month. + // + // * This functionality is reserved for recovering from an erroneous config, + // and should not be used for regular business cases. + // * The new config will not modify exports used with other configs. + // Changes to the config may be immediate, but may take up to 24 hours. + // * There is a limit of ten configs for any + // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement] + // or [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. + // * The contained [CustomerRepricingConfig.repricing_config][google.cloud.channel.v1.CustomerRepricingConfig.repricing_config] vaule must be + // different from the value used in the current config for a + // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement]. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. Also displays if the updated config is for the current month or + // past months. + // * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is + // not associated with the given account. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the updated [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise + // returns an error. + rpc CreateCustomerRepricingConfig(CreateCustomerRepricingConfigRequest) returns (CustomerRepricingConfig) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs" + body: "customer_repricing_config" + }; + option (google.api.method_signature) = "parent,customer_repricing_config"; + } + + // Updates a CustomerRepricingConfig. Call this method to set modifications + // for a specific customer's bill. This method overwrites the existing + // CustomerRepricingConfig. + // + // You can only update configs if the + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a + // future month. To make changes to configs for the current month, use + // [CreateCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfig], taking note of its restrictions. You + // cannot update the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. + // + // When updating a config in the future: + // + // * This config must already exist. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. Also displays if the updated config is for the current month or + // past months. + // * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is + // not associated with the given account. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the updated [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise + // returns an error. + rpc UpdateCustomerRepricingConfig(UpdateCustomerRepricingConfigRequest) returns (CustomerRepricingConfig) { + option (google.api.http) = { + patch: "/v1/{customer_repricing_config.name=accounts/*/customers/*/customerRepricingConfigs/*}" + body: "customer_repricing_config" + }; + option (google.api.method_signature) = "customer_repricing_config"; + } + + // Deletes the given [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] permanently. You can only + // delete configs if their [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is set + // to a date after the current month. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The account making the request does not own + // this customer. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * FAILED_PRECONDITION: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] is active or in the + // past. + // * NOT_FOUND: No [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] found for the name in the + // request. + rpc DeleteCustomerRepricingConfig(DeleteCustomerRepricingConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accounts/*/customers/*/customerRepricingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets information about how a Distributor modifies their bill before sending + // it to a ChannelPartner. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] was not found. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, otherwise + // returns an error. + rpc GetChannelPartnerRepricingConfig(GetChannelPartnerRepricingConfigRequest) returns (ChannelPartnerRepricingConfig) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists information about how a Reseller modifies their bill before sending + // it to a ChannelPartner. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist + // or is not associated with the given account. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resources. + // The data for each resource is displayed in the ascending order of: + // * channel partner ID + // * [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] + // * [ChannelPartnerRepricingConfig.update_time][google.cloud.channel.v1.ChannelPartnerRepricingConfig.update_time] + // + // If unsuccessful, returns an error. + rpc ListChannelPartnerRepricingConfigs(ListChannelPartnerRepricingConfigsRequest) returns (ListChannelPartnerRepricingConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a ChannelPartnerRepricingConfig. Call this method to set + // modifications for a specific ChannelPartner's bill. You can only create + // configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future + // month. If needed, you can create a config for the current month, with some + // restrictions. + // + // When creating a config for a future month, make sure there are no existing + // configs for that + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. + // + // The following restrictions are for creating configs in the current month. + // + // * This functionality is reserved for recovering from an erroneous config, + // and should not be used for regular business cases. + // * The new config will not modify exports used with other configs. + // Changes to the config may be immediate, but may take up to 24 hours. + // * There is a limit of ten configs for any ChannelPartner or + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. + // * The contained [ChannelPartnerRepricingConfig.repricing_config][google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config] vaule + // must be different from the value used in the current config for a + // ChannelPartner. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. Also displays if the updated config is for the current month or + // past months. + // * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist + // or is not associated with the given account. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the updated [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, + // otherwise returns an error. + rpc CreateChannelPartnerRepricingConfig(CreateChannelPartnerRepricingConfigRequest) returns (ChannelPartnerRepricingConfig) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs" + body: "channel_partner_repricing_config" + }; + option (google.api.method_signature) = "parent,channel_partner_repricing_config"; + } + + // Updates a ChannelPartnerRepricingConfig. Call this method to set + // modifications for a specific ChannelPartner's bill. This method overwrites + // the existing CustomerRepricingConfig. + // + // You can only update configs if the + // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a + // future month. To make changes to configs for the current month, use + // [CreateChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfig], taking note of its restrictions. + // You cannot update the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. + // + // When updating a config in the future: + // + // * This config must already exist. + // + // Possible Error Codes: + // + // * PERMISSION_DENIED: If the account making the request and the account + // being queried are different. + // * INVALID_ARGUMENT: Missing or invalid required parameters in the + // request. Also displays if the updated config is for the current month or + // past months. + // * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist + // or is not associated with the given account. + // * INTERNAL: Any non-user error related to technical issues in the + // backend. In this case, contact Cloud Channel support. + // + // Return Value: + // If successful, the updated [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, + // otherwise returns an error. + rpc UpdateChannelPartnerRepricingConfig(UpdateChannelPartnerRepricingConfigRequest) returns (ChannelPartnerRepricingConfig) { + option (google.api.http) = { + patch: "/v1/{channel_partner_repricing_config.name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}" + body: "channel_partner_repricing_config" + }; + option (google.api.method_signature) = "channel_partner_repricing_config"; + } + + // Deletes the given [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] permanently. You can + // only delete configs if their [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is + // set to a date after the current month. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The account making the request does not own + // this customer. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * FAILED_PRECONDITION: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] is active or + // in the past. + // * NOT_FOUND: No [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] found for the name in the + // request. + rpc DeleteChannelPartnerRepricingConfig(DeleteChannelPartnerRepricingConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the requested [Offer][google.cloud.channel.v1.Offer] resource. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The entitlement doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: Entitlement or offer was not found. + // + // Return value: + // The [Offer][google.cloud.channel.v1.Offer] resource. + rpc LookupOffer(LookupOfferRequest) returns (Offer) { + option (google.api.http) = { + get: "/v1/{entitlement=accounts/*/customers/*/entitlements/*}:lookupOffer" + }; + } + + // Lists the Products the reseller is authorized to sell. + // + // Possible error codes: + // + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { + option (google.api.http) = { + get: "/v1/products" + }; + } + + // Lists the SKUs for a product the reseller is authorized to sell. + // + // Possible error codes: + // + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + rpc ListSkus(ListSkusRequest) returns (ListSkusResponse) { + option (google.api.http) = { + get: "/v1/{parent=products/*}/skus" + }; + } + + // Lists the Offers the reseller can sell. + // + // Possible error codes: + // + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + rpc ListOffers(ListOffersRequest) returns (ListOffersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/offers" + }; + } + + // Lists the following: + // + // * SKUs that you can purchase for a customer + // * SKUs that you can upgrade or downgrade for an entitlement. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + rpc ListPurchasableSkus(ListPurchasableSkusRequest) returns (ListPurchasableSkusResponse) { + option (google.api.http) = { + get: "/v1/{customer=accounts/*/customers/*}:listPurchasableSkus" + }; + } + + // Lists the following: + // + // * Offers that you can purchase for a customer. + // * Offers that you can change for an entitlement. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + rpc ListPurchasableOffers(ListPurchasableOffersRequest) returns (ListPurchasableOffersResponse) { + option (google.api.http) = { + get: "/v1/{customer=accounts/*/customers/*}:listPurchasableOffers" + }; + } + + // Registers a service account with subscriber privileges on the Cloud Pub/Sub + // topic for this Channel Services account. After you create a + // subscriber, you get the events through [SubscriberEvent][google.cloud.channel.v1.SubscriberEvent] + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request and the + // provided reseller account are different, or the impersonated user + // is not a super admin. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The topic name with the registered service email address. + rpc RegisterSubscriber(RegisterSubscriberRequest) returns (RegisterSubscriberResponse) { + option (google.api.http) = { + post: "/v1/{account=accounts/*}:register" + body: "*" + }; + } + + // Unregisters a service account with subscriber privileges on the Cloud + // Pub/Sub topic created for this Channel Services account. If there are no + // service accounts left with subscriber privileges, this deletes the topic. + // You can call ListSubscribers to check for these accounts. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request and the + // provided reseller account are different, or the impersonated user + // is not a super admin. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The topic resource doesn't exist. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // The topic name that unregistered the service email address. + // Returns a success response if the service email address wasn't registered + // with the topic. + rpc UnregisterSubscriber(UnregisterSubscriberRequest) returns (UnregisterSubscriberResponse) { + option (google.api.http) = { + post: "/v1/{account=accounts/*}:unregister" + body: "*" + }; + } + + // Lists service accounts with subscriber privileges on the Cloud Pub/Sub + // topic created for this Channel Services account. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The reseller account making the request and the + // provided reseller account are different, or the impersonated user + // is not a super admin. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // * NOT_FOUND: The topic resource doesn't exist. + // * INTERNAL: Any non-user error related to a technical issue in the + // backend. Contact Cloud Channel support. + // * UNKNOWN: Any non-user error related to a technical issue in the backend. + // Contact Cloud Channel support. + // + // Return value: + // A list of service email addresses. + rpc ListSubscribers(ListSubscribersRequest) returns (ListSubscribersResponse) { + option (google.api.http) = { + get: "/v1/{account=accounts/*}:listSubscribers" + }; + } +} + +// Request message for [CloudChannelService.CheckCloudIdentityAccountsExist][google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist]. +message CheckCloudIdentityAccountsExistRequest { + // Required. The reseller account's resource name. + // Parent uses the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Domain to fetch for Cloud Identity account customer. + string domain = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Entity representing a Cloud Identity account that may be +// associated with a Channel Services API partner. +message CloudIdentityCustomerAccount { + // Returns true if a Cloud Identity account exists for a specific domain. + bool existing = 1; + + // Returns true if the Cloud Identity account is associated with a customer + // of the Channel Services partner. + bool owned = 2; + + // If owned = true, the name of the customer that owns the Cloud Identity + // account. + // Customer_name uses the format: + // accounts/{account_id}/customers/{customer_id} + string customer_name = 3; + + // If existing = true, the Cloud Identity ID of the customer. + string customer_cloud_identity_id = 4; +} + +// Response message for +// [CloudChannelService.CheckCloudIdentityAccountsExist][google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist]. +message CheckCloudIdentityAccountsExistResponse { + // The Cloud Identity accounts associated with the domain. + repeated CloudIdentityCustomerAccount cloud_identity_accounts = 1; +} + +// Request message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] +message ListCustomersRequest { + // Required. The resource name of the reseller account to list customers from. + // Parent uses the format: accounts/{account_id}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of customers to return. The service may return fewer + // than this value. If unspecified, returns at most 10 customers. The + // maximum value is 50. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results other than the first page. + // Obtained through + // [ListCustomersResponse.next_page_token][google.cloud.channel.v1.ListCustomersResponse.next_page_token] of the previous + // [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filters applied to the [CloudChannelService.ListCustomers] results. See + // https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers + // for more information. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers]. +message ListCustomersResponse { + // The customers belonging to a reseller or distributor. + repeated Customer customers = 1; + + // A token to retrieve the next page of results. + // Pass to [ListCustomersRequest.page_token][google.cloud.channel.v1.ListCustomersRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.GetCustomer][google.cloud.channel.v1.CloudChannelService.GetCustomer]. +message GetCustomerRequest { + // Required. The resource name of the customer to retrieve. + // Name uses the format: accounts/{account_id}/customers/{customer_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; +} + +// Request message for [CloudChannelService.CreateCustomer][google.cloud.channel.v1.CloudChannelService.CreateCustomer] +message CreateCustomerRequest { + // Required. The resource name of reseller account in which to create the customer. + // Parent uses the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The customer to create. + Customer customer = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.UpdateCustomer][google.cloud.channel.v1.CloudChannelService.UpdateCustomer]. +message UpdateCustomerRequest { + // Required. New contents of the customer. + Customer customer = 2 [(google.api.field_behavior) = REQUIRED]; + + // The update mask that applies to the resource. + // Optional. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for [CloudChannelService.DeleteCustomer][google.cloud.channel.v1.CloudChannelService.DeleteCustomer]. +message DeleteCustomerRequest { + // Required. The resource name of the customer to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; +} + +// Request message for [CloudChannelService.ImportCustomer][google.cloud.channel.v1.CloudChannelService.ImportCustomer] +message ImportCustomerRequest { + // Specifies the identity of the transfer customer. + // A customer's cloud_identity_id or domain is required to look up the + // customer's Cloud Identity. For Team customers, only the cloud_identity_id + // option is valid. + oneof customer_identity { + // Required. Customer domain. + string domain = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Customer's Cloud Identity ID + string cloud_identity_id = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The resource name of the reseller's account. + // Parent takes the format: accounts/{account_id} or + // accounts/{account_id}/channelPartnerLinks/{channel_partner_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The super admin of the resold customer generates this token to + // authorize a reseller to access their Cloud Identity and purchase + // entitlements on their behalf. You can omit this token after authorization. + // See https://support.google.com/a/answer/7643790 for more details. + string auth_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Choose to overwrite an existing customer if found. + // This must be set to true if there is an existing customer with a + // conflicting region code or domain. + bool overwrite_if_exists = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Cloud Identity ID of a channel partner who will be the direct reseller for + // the customer's order. This field is required for 2-tier transfer scenarios + // and can be provided via the request Parent binding as well. + string channel_partner_id = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the customer that will receive imported Cloud Identity + // information. + // Format: accounts/{account_id}/customers/{customer_id} + string customer = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; +} + +// Request message for [CloudChannelService.ProvisionCloudIdentity][google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity] +message ProvisionCloudIdentityRequest { + // Required. Resource name of the customer. + // Format: accounts/{account_id}/customers/{customer_id} + string customer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // CloudIdentity-specific customer information. + CloudIdentityInfo cloud_identity_info = 2; + + // Admin user information. + AdminUser user = 3; + + // Validate the request and preview the review, but do not post it. + bool validate_only = 4; +} + +// Request message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] +message ListEntitlementsRequest { + // Required. The resource name of the reseller's customer account to list + // entitlements for. + // Parent uses the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, return at most 50 entitlements. + // The maximum value is 100; the server will coerce values above 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + // Obtained using + // [ListEntitlementsResponse.next_page_token][google.cloud.channel.v1.ListEntitlementsResponse.next_page_token] of the previous + // [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements]. +message ListEntitlementsResponse { + // The reseller customer's entitlements. + repeated Entitlement entitlements = 1; + + // A token to list the next page of results. + // Pass to [ListEntitlementsRequest.page_token][google.cloud.channel.v1.ListEntitlementsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus] +message ListTransferableSkusRequest { + // Specifies the identity of transferred customer. + // Either a cloud_identity_id of the customer or the customer name is + // required to look up transferable SKUs. + oneof transferred_customer_identity { + // Customer's Cloud Identity ID + string cloud_identity_id = 4; + + // A reseller is required to create a customer and use the resource name of + // the created customer here. + // Customer_name uses the format: + // accounts/{account_id}/customers/{customer_id} + string customer_name = 7; + } + + // Required. The reseller account's resource name. + // Parent uses the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 100 SKUs. + // The maximum value is 1000; the server will coerce values above 1000. + // Optional. + int32 page_size = 2; + + // A token for a page of results other than the first page. + // Obtained using + // [ListTransferableSkusResponse.next_page_token][google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token] of the previous + // [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus] call. + // Optional. + string page_token = 3; + + // Optional. The super admin of the resold customer generates this token to + // authorize a reseller to access their Cloud Identity and purchase + // entitlements on their behalf. You can omit this token after authorization. + // See https://support.google.com/a/answer/7643790 for more details. + string auth_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + // Optional. + string language_code = 6; +} + +// Response message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus]. +message ListTransferableSkusResponse { + // Information about existing SKUs for a customer that needs a transfer. + repeated TransferableSku transferable_skus = 1; + + // A token to retrieve the next page of results. + // Pass to [ListTransferableSkusRequest.page_token][google.cloud.channel.v1.ListTransferableSkusRequest.page_token] to obtain + // that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers] +message ListTransferableOffersRequest { + // Specifies the identity of transferred customer. + // Either a cloud_identity_id of the customer or the customer name is + // required to look up transferrable Offers. + oneof transferred_customer_identity { + // Customer's Cloud Identity ID + string cloud_identity_id = 4; + + // A reseller should create a customer and use the resource name of + // that customer here. + string customer_name = 5; + } + + // Required. The resource name of the reseller's account. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 100 offers. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 2; + + // A token for a page of results other than the first page. + // Obtained using + // [ListTransferableOffersResponse.next_page_token][google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token] of the previous + // [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers] call. + string page_token = 3; + + // Required. The SKU to look up Offers for. + string sku = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + string language_code = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers]. +message ListTransferableOffersResponse { + // Information about Offers for a customer that can be used for + // transfer. + repeated TransferableOffer transferable_offers = 1; + + // A token to retrieve the next page of results. + // Pass to [ListTransferableOffersRequest.page_token][google.cloud.channel.v1.ListTransferableOffersRequest.page_token] to obtain + // that page. + string next_page_token = 2; +} + +// TransferableOffer represents an Offer that can be used in Transfer. +// Read-only. +message TransferableOffer { + // Offer with parameter constraints updated to allow the Transfer. + Offer offer = 1; +} + +// Request message for [CloudChannelService.GetEntitlement][google.cloud.channel.v1.CloudChannelService.GetEntitlement]. +message GetEntitlementRequest { + // Required. The resource name of the entitlement to retrieve. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + } + ]; +} + +// Request message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] +message ListChannelPartnerLinksRequest { + // Required. The resource name of the reseller account for listing channel partner + // links. + // Parent uses the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, server will pick a default size (25). + // The maximum value is 200; the server will coerce values above 200. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + // Obtained using + // [ListChannelPartnerLinksResponse.next_page_token][google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token] of the previous + // [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The level of granularity the ChannelPartnerLink will display. + ChannelPartnerLinkView view = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks]. +message ListChannelPartnerLinksResponse { + // The Channel partner links for a reseller. + repeated ChannelPartnerLink channel_partner_links = 1; + + // A token to retrieve the next page of results. + // Pass to [ListChannelPartnerLinksRequest.page_token][google.cloud.channel.v1.ListChannelPartnerLinksRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.GetChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLink]. +message GetChannelPartnerLinkRequest { + // Required. The resource name of the channel partner link to retrieve. + // Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} + // where {id} is the Cloud Identity ID of the partner. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The level of granularity the ChannelPartnerLink will display. + ChannelPartnerLinkView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.CreateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink] +message CreateChannelPartnerLinkRequest { + // Required. Create a channel partner link for the provided reseller account's + // resource name. + // Parent uses the format: accounts/{account_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The channel partner link to create. + // Either channel_partner_link.reseller_cloud_identity_id or domain can be + // used to create a link. + ChannelPartnerLink channel_partner_link = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.UpdateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink] +message UpdateChannelPartnerLinkRequest { + // Required. The resource name of the channel partner link to cancel. + // Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} + // where {id} is the Cloud Identity ID of the partner. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The channel partner link to update. Only channel_partner_link.link_state + // is allowed for updates. + ChannelPartnerLink channel_partner_link = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask that applies to the resource. + // The only allowable value for an update mask is + // channel_partner_link.link_state. + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.GetCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig]. +message GetCustomerRepricingConfigRequest { + // Required. The resource name of the CustomerRepricingConfig. + // Format: + // accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/CustomerRepricingConfig" + } + ]; +} + +// Request message for [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs]. +message ListCustomerRepricingConfigsRequest { + // Required. The resource name of the customer. + // Parent uses the format: accounts/{account_id}/customers/{customer_id}. + // Supports accounts/{account_id}/customers/- to retrieve configs for all + // customers. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. The maximum number of repricing configs to return. The service may return + // fewer than this value. If unspecified, returns a maximum of 50 rules. The + // maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results beyond the first page. + // Obtained through + // [ListCustomerRepricingConfigsResponse.next_page_token][google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token] of the previous + // [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs] + // results (customer only). You can use this filter when you support + // a BatchGet-like query. + // To use the filter, you must set `parent=accounts/{account_id}/customers/-`. + // + // Example: customer = accounts/account_id/customers/c1 OR + // customer = accounts/account_id/customers/c2. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs]. +message ListCustomerRepricingConfigsResponse { + // The repricing configs for this channel partner. + repeated CustomerRepricingConfig customer_repricing_configs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListCustomerRepricingConfigsRequest.page_token][google.cloud.channel.v1.ListCustomerRepricingConfigsRequest.page_token] to obtain that + // page. + string next_page_token = 2; +} + +// Request message for [CloudChannelService.CreateCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfig]. +message CreateCustomerRepricingConfigRequest { + // Required. The resource name of the customer that will receive this repricing config. + // Parent uses the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Required. The CustomerRepricingConfig object to update. + CustomerRepricingConfig customer_repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.UpdateCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfig]. +message UpdateCustomerRepricingConfigRequest { + // Required. The CustomerRepricingConfig object to update. + CustomerRepricingConfig customer_repricing_config = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [CloudChannelService.DeleteCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfig]. +message DeleteCustomerRepricingConfigRequest { + // Required. The resource name of the customer repricing config rule to delete. + // Format: + // accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/CustomerRepricingConfig" + } + ]; +} + +// Request message for [CloudChannelService.GetChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig] +message GetChannelPartnerRepricingConfigRequest { + // Required. The resource name of the ChannelPartnerRepricingConfig + // Format: + // accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig" + } + ]; +} + +// Request message for +// [CloudChannelService.ListChannelPartnerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs]. +message ListChannelPartnerRepricingConfigsRequest { + // Required. The resource name of the account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]. + // Parent uses the format: + // accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. + // Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs + // for all channel partners. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/ChannelPartnerLink" + } + ]; + + // Optional. The maximum number of repricing configs to return. The service may return + // fewer than this value. If unspecified, returns a maximum of 50 rules. The + // maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results beyond the first page. + // Obtained through + // [ListChannelPartnerRepricingConfigsResponse.next_page_token][google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.next_page_token] of the + // previous [CloudChannelService.ListChannelPartnerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs] call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter for [CloudChannelService.ListChannelPartnerRepricingConfigs] + // results (channel_partner_link only). You can use this filter when you + // support a BatchGet-like query. + // To use the filter, you must set + // `parent=accounts/{account_id}/channelPartnerLinks/-`. + // + // Example: `channel_partner_link = + // accounts/account_id/channelPartnerLinks/c1` OR `channel_partner_link = + // accounts/account_id/channelPartnerLinks/c2`. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [CloudChannelService.ListChannelPartnerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs]. +message ListChannelPartnerRepricingConfigsResponse { + // The repricing configs for this channel partner. + repeated ChannelPartnerRepricingConfig channel_partner_repricing_configs = 1; + + // A token to retrieve the next page of results. + // Pass to [ListChannelPartnerRepricingConfigsRequest.page_token][google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest.page_token] to obtain + // that page. + string next_page_token = 2; +} + +// Request message for +// [CloudChannelService.CreateChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfig]. +message CreateChannelPartnerRepricingConfigRequest { + // Required. The resource name of the ChannelPartner that will receive the repricing + // config. Parent uses the format: + // accounts/{account_id}/channelPartnerLinks/{channel_partner_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/ChannelPartnerLink" + } + ]; + + // Required. The ChannelPartnerRepricingConfig object to update. + ChannelPartnerRepricingConfig channel_partner_repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [CloudChannelService.UpdateChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerRepricingConfig]. +message UpdateChannelPartnerRepricingConfigRequest { + // Required. The ChannelPartnerRepricingConfig object to update. + ChannelPartnerRepricingConfig channel_partner_repricing_config = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteChannelPartnerRepricingConfig. +message DeleteChannelPartnerRepricingConfigRequest { + // Required. The resource name of the channel partner repricing config rule to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig" + } + ]; +} + +// Request message for [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement] +message CreateEntitlementRequest { + // Required. The resource name of the reseller's customer account in which to create the + // entitlement. + // Parent uses the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Required. The entitlement to create. + Entitlement entitlement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +message TransferEntitlementsRequest { + // Required. The resource name of the reseller's customer account that will receive + // transferred entitlements. + // Parent uses the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new entitlements to create or transfer. + repeated Entitlement entitlements = 2 [(google.api.field_behavior) = REQUIRED]; + + // The super admin of the resold customer generates this token to + // authorize a reseller to access their Cloud Identity and purchase + // entitlements on their behalf. You can omit this token after authorization. + // See https://support.google.com/a/answer/7643790 for more details. + string auth_token = 4; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +// This is put in the response field of google.longrunning.Operation. +message TransferEntitlementsResponse { + // The transferred entitlements. + repeated Entitlement entitlements = 1; +} + +// Request message for [CloudChannelService.TransferEntitlementsToGoogle][google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogle]. +message TransferEntitlementsToGoogleRequest { + // Required. The resource name of the reseller's customer account where the entitlements + // transfer from. + // Parent uses the format: accounts/{account_id}/customers/{customer_id} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entitlements to transfer to Google. + repeated Entitlement entitlements = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ChangeParametersRequest][]. +message ChangeParametersRequest { + // Required. The name of the entitlement to update. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Entitlement parameters to update. You can only change editable parameters. + // + // To view the available Parameters for a request, refer to the + // [Offer.parameter_definitions][google.cloud.channel.v1.Offer.parameter_definitions] from the desired offer. + repeated Parameter parameters = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Purchase order ID provided by the reseller. + string purchase_order_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ChangeRenewalSettings][google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings]. +message ChangeRenewalSettingsRequest { + // Required. The name of the entitlement to update. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. New renewal settings. + RenewalSettings renewal_settings = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. +message ChangeOfferRequest { + // Required. The resource name of the entitlement to update. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. New Offer. + // Format: accounts/{account_id}/offers/{offer_id}. + string offer = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Offer" + } + ]; + + // Optional. Parameters needed to purchase the Offer. To view the available Parameters + // refer to the [Offer.parameter_definitions][google.cloud.channel.v1.Offer.parameter_definitions] from the desired offer. + repeated Parameter parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Purchase order id provided by the reseller. + string purchase_order_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.StartPaidService][google.cloud.channel.v1.CloudChannelService.StartPaidService]. +message StartPaidServiceRequest { + // Required. The name of the entitlement to start a paid service for. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.CancelEntitlement][google.cloud.channel.v1.CloudChannelService.CancelEntitlement]. +message CancelEntitlementRequest { + // Required. The resource name of the entitlement to cancel. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.SuspendEntitlement][google.cloud.channel.v1.CloudChannelService.SuspendEntitlement]. +message SuspendEntitlementRequest { + // Required. The resource name of the entitlement to suspend. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [CloudChannelService.ActivateEntitlement][google.cloud.channel.v1.CloudChannelService.ActivateEntitlement]. +message ActivateEntitlementRequest { + // Required. The resource name of the entitlement to activate. + // Name uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. You can specify an optional unique request ID, and if you need to retry + // your request, the server will know to ignore the request if it's complete. + // + // For example, you make an initial request and the request times out. If you + // make the request again with the same request ID, the server can check if + // it received the original operation with the same request ID. If it did, it + // will ignore the second request. + // + // The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + // with the exception that zero UUID is not supported + // (`00000000-0000-0000-0000-000000000000`). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for LookupOffer. +message LookupOfferRequest { + // Required. The resource name of the entitlement to retrieve the Offer. + // Entitlement uses the format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + } + ]; +} + +// Request message for ListProducts. +message ListProductsRequest { + // Required. The resource name of the reseller account. + // Format: accounts/{account_id}. + string account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 100 Products. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListProducts. +message ListProductsResponse { + // List of Products requested. + repeated Product products = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// Request message for ListSkus. +message ListSkusRequest { + // Required. The resource name of the Product to list SKUs for. + // Parent uses the format: products/{product_id}. + // Supports products/- to retrieve SKUs for all products. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Product" + } + ]; + + // Required. Resource name of the reseller. + // Format: accounts/{account_id}. + string account = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 100 SKUs. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + // Optional. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + string language_code = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListSkus. +message ListSkusResponse { + // The list of SKUs requested. + repeated Sku skus = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// Request message for ListOffers. +message ListOffersRequest { + // Required. The resource name of the reseller account from which to list Offers. + // Parent uses the format: accounts/{account_id}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 500 Offers. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expression to filter results by name (name of + // the Offer), sku.name (name of the SKU), or sku.product.name (name of the + // Product). + // Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1 + // Example 2: name=accounts/a1/offers/o1 + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + string language_code = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListOffers. +message ListOffersResponse { + // The list of Offers requested. + repeated Offer offers = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// Request message for ListPurchasableSkus. +message ListPurchasableSkusRequest { + // List SKUs for a new entitlement. Make the purchase using + // [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement]. + message CreateEntitlementPurchase { + // Required. List SKUs belonging to this Product. + // Format: products/{product_id}. + // Supports products/- to retrieve SKUs for all products. + string product = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // List SKUs for upgrading or downgrading an entitlement. Make the purchase + // using [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. + message ChangeOfferPurchase { + // Change Type enum. + enum ChangeType { + // Not used. + CHANGE_TYPE_UNSPECIFIED = 0; + + // SKU is an upgrade on the current entitlement. + UPGRADE = 1; + + // SKU is a downgrade on the current entitlement. + DOWNGRADE = 2; + } + + // Required. Resource name of the entitlement. + // Format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Change Type for the entitlement. + ChangeType change_type = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Defines the intended purchase. + oneof purchase_option { + // List SKUs for CreateEntitlement purchase. + CreateEntitlementPurchase create_entitlement_purchase = 2; + + // List SKUs for ChangeOffer purchase with a new SKU. + ChangeOfferPurchase change_offer_purchase = 3; + } + + // Required. The resource name of the customer to list SKUs for. + // Format: accounts/{account_id}/customers/{customer_id}. + string customer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 100 SKUs. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPurchasableSkus. +message ListPurchasableSkusResponse { + // The list of SKUs requested. + repeated PurchasableSku purchasable_skus = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// SKU that you can purchase. This is used in ListPurchasableSku API +// response. +message PurchasableSku { + // SKU + Sku sku = 1; +} + +// Request message for ListPurchasableOffers. +message ListPurchasableOffersRequest { + // List Offers for CreateEntitlement purchase. + message CreateEntitlementPurchase { + // Required. SKU that the result should be restricted to. + // Format: products/{product_id}/skus/{sku_id}. + string sku = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // List Offers for ChangeOffer purchase. + message ChangeOfferPurchase { + // Required. Resource name of the entitlement. + // Format: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Resource name of the new target SKU. Provide this SKU when + // upgrading or downgrading an entitlement. Format: + // products/{product_id}/skus/{sku_id} + string new_sku = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines the intended purchase. + oneof purchase_option { + // List Offers for CreateEntitlement purchase. + CreateEntitlementPurchase create_entitlement_purchase = 2; + + // List Offers for ChangeOffer purchase. + ChangeOfferPurchase change_offer_purchase = 3; + } + + // Required. The resource name of the customer to list Offers for. + // Format: accounts/{account_id}/customers/{customer_id}. + string customer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Optional. Requested page size. Server might return fewer results than requested. + // If unspecified, returns at most 100 Offers. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token for a page of results other than the first page. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The BCP-47 language code. For example, "en-US". The + // response will localize in the corresponding language code, if specified. + // The default value is "en-US". + string language_code = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPurchasableOffers. +message ListPurchasableOffersResponse { + // The list of Offers requested. + repeated PurchasableOffer purchasable_offers = 1; + + // A token to retrieve the next page of results. + string next_page_token = 2; +} + +// Offer that you can purchase for a customer. This is used in the +// ListPurchasableOffer API response. +message PurchasableOffer { + // Offer. + Offer offer = 1; +} + +// Request Message for RegisterSubscriber. +message RegisterSubscriberRequest { + // Required. Resource name of the account. + string account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Service account that provides subscriber access to the registered topic. + string service_account = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response Message for RegisterSubscriber. +message RegisterSubscriberResponse { + // Name of the topic the subscriber will listen to. + string topic = 1; +} + +// Request Message for UnregisterSubscriber. +message UnregisterSubscriberRequest { + // Required. Resource name of the account. + string account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Service account to unregister from subscriber access to the topic. + string service_account = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response Message for UnregisterSubscriber. +message UnregisterSubscriberResponse { + // Name of the topic the service account subscriber access was removed from. + string topic = 1; +} + +// Request Message for ListSubscribers. +message ListSubscribersRequest { + // Required. Resource name of the account. + string account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of service accounts to return. The service may return + // fewer than this value. + // If unspecified, returns at most 100 service accounts. + // The maximum value is 1000; the server will coerce values above 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSubscribers` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSubscribers` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response Message for ListSubscribers. +message ListSubscribersResponse { + // Name of the topic registered with the reseller. + string topic = 1; + + // List of service accounts which have subscriber access to the topic. + repeated string service_accounts = 2; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 3; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto new file mode 100644 index 00000000000..3c67216ed65 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto @@ -0,0 +1,119 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this 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.channel.v1; + +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/channel/v1;channel"; +option java_multiple_files = true; +option java_outer_classname = "SubscriberEventProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Represents Pub/Sub message content describing customer update. +message CustomerEvent { + // Type of customer event. + enum Type { + // Not used. + TYPE_UNSPECIFIED = 0; + + // Primary domain for customer was changed. + PRIMARY_DOMAIN_CHANGED = 1; + + // Primary domain of the customer has been verified. + PRIMARY_DOMAIN_VERIFIED = 2; + } + + // Resource name of the customer. + // Format: accounts/{account_id}/customers/{customer_id} + string customer = 1 [(google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + }]; + + // Type of event which happened on the customer. + Type event_type = 2; +} + +// Represents Pub/Sub message content describing entitlement update. +message EntitlementEvent { + // Type of entitlement event. + enum Type { + // Not used. + TYPE_UNSPECIFIED = 0; + + // A new entitlement was created. + CREATED = 1; + + // The offer type associated with an entitlement was changed. + // This is not triggered if an entitlement converts from a commit offer to a + // flexible offer as part of a renewal. + PRICE_PLAN_SWITCHED = 3; + + // Annual commitment for a commit plan was changed. + COMMITMENT_CHANGED = 4; + + // An annual entitlement was renewed. + RENEWED = 5; + + // Entitlement was suspended. + SUSPENDED = 6; + + // Entitlement was unsuspended. + ACTIVATED = 7; + + // Entitlement was cancelled. + CANCELLED = 8; + + // Entitlement was upgraded or downgraded (e.g. from Google Workspace + // Business Standard to Google Workspace Business Plus). + SKU_CHANGED = 9; + + // The renewal settings of an entitlement has changed. + RENEWAL_SETTING_CHANGED = 10; + + // Paid service has started on trial entitlement. + PAID_SERVICE_STARTED = 11; + + // License was assigned to or revoked from a user. + LICENSE_ASSIGNMENT_CHANGED = 12; + + // License cap was changed for the entitlement. + LICENSE_CAP_CHANGED = 13; + } + + // Resource name of an entitlement of the form: + // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + string entitlement = 1 [(google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Entitlement" + }]; + + // Type of event which happened on the entitlement. + Type event_type = 2; +} + +// Represents information which resellers will get as part of notification from +// Pub/Sub. +message SubscriberEvent { + // Specifies the Pub/Sub event provided to the partners. + // This is a required field. + oneof event { + // Customer event sent as part of Pub/Sub event to partners. + CustomerEvent customer_event = 1; + + // Entitlement event sent as part of Pub/Sub event to partners. + EntitlementEvent entitlement_event = 2; + } +} diff --git a/packages/google-cloud-channel/protos/protos.d.ts b/packages/google-cloud-channel/protos/protos.d.ts new file mode 100644 index 00000000000..7d3c465c6f1 --- /dev/null +++ b/packages/google-cloud-channel/protos/protos.d.ts @@ -0,0 +1,21277 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace channel. */ + namespace channel { + + /** Namespace v1. */ + namespace v1 { + + /** ChannelPartnerLinkView enum. */ + enum ChannelPartnerLinkView { + UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** ChannelPartnerLinkState enum. */ + enum ChannelPartnerLinkState { + CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED = 0, + INVITED = 1, + ACTIVE = 2, + REVOKED = 3, + SUSPENDED = 4 + } + + /** Properties of a ChannelPartnerLink. */ + interface IChannelPartnerLink { + + /** ChannelPartnerLink name */ + name?: (string|null); + + /** ChannelPartnerLink resellerCloudIdentityId */ + resellerCloudIdentityId?: (string|null); + + /** ChannelPartnerLink linkState */ + linkState?: (google.cloud.channel.v1.ChannelPartnerLinkState|keyof typeof google.cloud.channel.v1.ChannelPartnerLinkState|null); + + /** ChannelPartnerLink inviteLinkUri */ + inviteLinkUri?: (string|null); + + /** ChannelPartnerLink createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ChannelPartnerLink updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ChannelPartnerLink publicId */ + publicId?: (string|null); + + /** ChannelPartnerLink channelPartnerCloudIdentityInfo */ + channelPartnerCloudIdentityInfo?: (google.cloud.channel.v1.ICloudIdentityInfo|null); + } + + /** Represents a ChannelPartnerLink. */ + class ChannelPartnerLink implements IChannelPartnerLink { + + /** + * Constructs a new ChannelPartnerLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IChannelPartnerLink); + + /** ChannelPartnerLink name. */ + public name: string; + + /** ChannelPartnerLink resellerCloudIdentityId. */ + public resellerCloudIdentityId: string; + + /** ChannelPartnerLink linkState. */ + public linkState: (google.cloud.channel.v1.ChannelPartnerLinkState|keyof typeof google.cloud.channel.v1.ChannelPartnerLinkState); + + /** ChannelPartnerLink inviteLinkUri. */ + public inviteLinkUri: string; + + /** ChannelPartnerLink createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ChannelPartnerLink updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ChannelPartnerLink publicId. */ + public publicId: string; + + /** ChannelPartnerLink channelPartnerCloudIdentityInfo. */ + public channelPartnerCloudIdentityInfo?: (google.cloud.channel.v1.ICloudIdentityInfo|null); + + /** + * Creates a new ChannelPartnerLink instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelPartnerLink instance + */ + public static create(properties?: google.cloud.channel.v1.IChannelPartnerLink): google.cloud.channel.v1.ChannelPartnerLink; + + /** + * Encodes the specified ChannelPartnerLink message. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerLink.verify|verify} messages. + * @param message ChannelPartnerLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IChannelPartnerLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelPartnerLink message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerLink.verify|verify} messages. + * @param message ChannelPartnerLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IChannelPartnerLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelPartnerLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelPartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ChannelPartnerLink; + + /** + * Decodes a ChannelPartnerLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelPartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ChannelPartnerLink; + + /** + * Verifies a ChannelPartnerLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelPartnerLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelPartnerLink + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ChannelPartnerLink; + + /** + * Creates a plain object from a ChannelPartnerLink message. Also converts values to other types if specified. + * @param message ChannelPartnerLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ChannelPartnerLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelPartnerLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelPartnerLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EduData. */ + interface IEduData { + + /** EduData instituteType */ + instituteType?: (google.cloud.channel.v1.EduData.InstituteType|keyof typeof google.cloud.channel.v1.EduData.InstituteType|null); + + /** EduData instituteSize */ + instituteSize?: (google.cloud.channel.v1.EduData.InstituteSize|keyof typeof google.cloud.channel.v1.EduData.InstituteSize|null); + + /** EduData website */ + website?: (string|null); + } + + /** Represents an EduData. */ + class EduData implements IEduData { + + /** + * Constructs a new EduData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IEduData); + + /** EduData instituteType. */ + public instituteType: (google.cloud.channel.v1.EduData.InstituteType|keyof typeof google.cloud.channel.v1.EduData.InstituteType); + + /** EduData instituteSize. */ + public instituteSize: (google.cloud.channel.v1.EduData.InstituteSize|keyof typeof google.cloud.channel.v1.EduData.InstituteSize); + + /** EduData website. */ + public website: string; + + /** + * Creates a new EduData instance using the specified properties. + * @param [properties] Properties to set + * @returns EduData instance + */ + public static create(properties?: google.cloud.channel.v1.IEduData): google.cloud.channel.v1.EduData; + + /** + * Encodes the specified EduData message. Does not implicitly {@link google.cloud.channel.v1.EduData.verify|verify} messages. + * @param message EduData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IEduData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EduData message, length delimited. Does not implicitly {@link google.cloud.channel.v1.EduData.verify|verify} messages. + * @param message EduData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IEduData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EduData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EduData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.EduData; + + /** + * Decodes an EduData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EduData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.EduData; + + /** + * Verifies an EduData message. + * @param message Plain 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 EduData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EduData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.EduData; + + /** + * Creates a plain object from an EduData message. Also converts values to other types if specified. + * @param message EduData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.EduData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EduData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EduData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EduData { + + /** InstituteType enum. */ + enum InstituteType { + INSTITUTE_TYPE_UNSPECIFIED = 0, + K12 = 1, + UNIVERSITY = 2 + } + + /** InstituteSize enum. */ + enum InstituteSize { + INSTITUTE_SIZE_UNSPECIFIED = 0, + SIZE_1_100 = 1, + SIZE_101_500 = 2, + SIZE_501_1000 = 3, + SIZE_1001_2000 = 4, + SIZE_2001_5000 = 5, + SIZE_5001_10000 = 6, + SIZE_10001_OR_MORE = 7 + } + } + + /** Properties of a CloudIdentityInfo. */ + interface ICloudIdentityInfo { + + /** CloudIdentityInfo customerType */ + customerType?: (google.cloud.channel.v1.CloudIdentityInfo.CustomerType|keyof typeof google.cloud.channel.v1.CloudIdentityInfo.CustomerType|null); + + /** CloudIdentityInfo primaryDomain */ + primaryDomain?: (string|null); + + /** CloudIdentityInfo isDomainVerified */ + isDomainVerified?: (boolean|null); + + /** CloudIdentityInfo alternateEmail */ + alternateEmail?: (string|null); + + /** CloudIdentityInfo phoneNumber */ + phoneNumber?: (string|null); + + /** CloudIdentityInfo languageCode */ + languageCode?: (string|null); + + /** CloudIdentityInfo adminConsoleUri */ + adminConsoleUri?: (string|null); + + /** CloudIdentityInfo eduData */ + eduData?: (google.cloud.channel.v1.IEduData|null); + } + + /** Represents a CloudIdentityInfo. */ + class CloudIdentityInfo implements ICloudIdentityInfo { + + /** + * Constructs a new CloudIdentityInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICloudIdentityInfo); + + /** CloudIdentityInfo customerType. */ + public customerType: (google.cloud.channel.v1.CloudIdentityInfo.CustomerType|keyof typeof google.cloud.channel.v1.CloudIdentityInfo.CustomerType); + + /** CloudIdentityInfo primaryDomain. */ + public primaryDomain: string; + + /** CloudIdentityInfo isDomainVerified. */ + public isDomainVerified: boolean; + + /** CloudIdentityInfo alternateEmail. */ + public alternateEmail: string; + + /** CloudIdentityInfo phoneNumber. */ + public phoneNumber: string; + + /** CloudIdentityInfo languageCode. */ + public languageCode: string; + + /** CloudIdentityInfo adminConsoleUri. */ + public adminConsoleUri: string; + + /** CloudIdentityInfo eduData. */ + public eduData?: (google.cloud.channel.v1.IEduData|null); + + /** + * Creates a new CloudIdentityInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudIdentityInfo instance + */ + public static create(properties?: google.cloud.channel.v1.ICloudIdentityInfo): google.cloud.channel.v1.CloudIdentityInfo; + + /** + * Encodes the specified CloudIdentityInfo message. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityInfo.verify|verify} messages. + * @param message CloudIdentityInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICloudIdentityInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudIdentityInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityInfo.verify|verify} messages. + * @param message CloudIdentityInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICloudIdentityInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudIdentityInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudIdentityInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CloudIdentityInfo; + + /** + * Decodes a CloudIdentityInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudIdentityInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CloudIdentityInfo; + + /** + * Verifies a CloudIdentityInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudIdentityInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudIdentityInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CloudIdentityInfo; + + /** + * Creates a plain object from a CloudIdentityInfo message. Also converts values to other types if specified. + * @param message CloudIdentityInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CloudIdentityInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudIdentityInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudIdentityInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudIdentityInfo { + + /** CustomerType enum. */ + enum CustomerType { + CUSTOMER_TYPE_UNSPECIFIED = 0, + DOMAIN = 1, + TEAM = 2 + } + } + + /** Properties of a Value. */ + interface IValue { + + /** Value int64Value */ + int64Value?: (number|Long|string|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value doubleValue */ + doubleValue?: (number|null); + + /** Value protoValue */ + protoValue?: (google.protobuf.IAny|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IValue); + + /** Value int64Value. */ + public int64Value?: (number|Long|string|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value doubleValue. */ + public doubleValue?: (number|null); + + /** Value protoValue. */ + public protoValue?: (google.protobuf.IAny|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value kind. */ + public kind?: ("int64Value"|"stringValue"|"doubleValue"|"protoValue"|"boolValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.cloud.channel.v1.IValue): google.cloud.channel.v1.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.cloud.channel.v1.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdminUser. */ + interface IAdminUser { + + /** AdminUser email */ + email?: (string|null); + + /** AdminUser givenName */ + givenName?: (string|null); + + /** AdminUser familyName */ + familyName?: (string|null); + } + + /** Represents an AdminUser. */ + class AdminUser implements IAdminUser { + + /** + * Constructs a new AdminUser. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IAdminUser); + + /** AdminUser email. */ + public email: string; + + /** AdminUser givenName. */ + public givenName: string; + + /** AdminUser familyName. */ + public familyName: string; + + /** + * Creates a new AdminUser instance using the specified properties. + * @param [properties] Properties to set + * @returns AdminUser instance + */ + public static create(properties?: google.cloud.channel.v1.IAdminUser): google.cloud.channel.v1.AdminUser; + + /** + * Encodes the specified AdminUser message. Does not implicitly {@link google.cloud.channel.v1.AdminUser.verify|verify} messages. + * @param message AdminUser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IAdminUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdminUser message, length delimited. Does not implicitly {@link google.cloud.channel.v1.AdminUser.verify|verify} messages. + * @param message AdminUser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IAdminUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdminUser message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdminUser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.AdminUser; + + /** + * Decodes an AdminUser message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdminUser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.AdminUser; + + /** + * Verifies an AdminUser message. + * @param message Plain 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 AdminUser message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdminUser + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.AdminUser; + + /** + * Creates a plain object from an AdminUser message. Also converts values to other types if specified. + * @param message AdminUser + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.AdminUser, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdminUser to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdminUser + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Customer. */ + interface ICustomer { + + /** Customer name */ + name?: (string|null); + + /** Customer orgDisplayName */ + orgDisplayName?: (string|null); + + /** Customer orgPostalAddress */ + orgPostalAddress?: (google.type.IPostalAddress|null); + + /** Customer primaryContactInfo */ + primaryContactInfo?: (google.cloud.channel.v1.IContactInfo|null); + + /** Customer alternateEmail */ + alternateEmail?: (string|null); + + /** Customer domain */ + domain?: (string|null); + + /** Customer createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Customer updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Customer cloudIdentityId */ + cloudIdentityId?: (string|null); + + /** Customer languageCode */ + languageCode?: (string|null); + + /** Customer cloudIdentityInfo */ + cloudIdentityInfo?: (google.cloud.channel.v1.ICloudIdentityInfo|null); + + /** Customer channelPartnerId */ + channelPartnerId?: (string|null); + } + + /** Represents a Customer. */ + class Customer implements ICustomer { + + /** + * Constructs a new Customer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICustomer); + + /** Customer name. */ + public name: string; + + /** Customer orgDisplayName. */ + public orgDisplayName: string; + + /** Customer orgPostalAddress. */ + public orgPostalAddress?: (google.type.IPostalAddress|null); + + /** Customer primaryContactInfo. */ + public primaryContactInfo?: (google.cloud.channel.v1.IContactInfo|null); + + /** Customer alternateEmail. */ + public alternateEmail: string; + + /** Customer domain. */ + public domain: string; + + /** Customer createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Customer updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Customer cloudIdentityId. */ + public cloudIdentityId: string; + + /** Customer languageCode. */ + public languageCode: string; + + /** Customer cloudIdentityInfo. */ + public cloudIdentityInfo?: (google.cloud.channel.v1.ICloudIdentityInfo|null); + + /** Customer channelPartnerId. */ + public channelPartnerId: string; + + /** + * Creates a new Customer instance using the specified properties. + * @param [properties] Properties to set + * @returns Customer instance + */ + public static create(properties?: google.cloud.channel.v1.ICustomer): google.cloud.channel.v1.Customer; + + /** + * Encodes the specified Customer message. Does not implicitly {@link google.cloud.channel.v1.Customer.verify|verify} messages. + * @param message Customer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICustomer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Customer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Customer.verify|verify} messages. + * @param message Customer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICustomer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Customer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Customer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Customer; + + /** + * Decodes a Customer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Customer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Customer; + + /** + * Verifies a Customer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Customer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Customer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Customer; + + /** + * Creates a plain object from a Customer message. Also converts values to other types if specified. + * @param message Customer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Customer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Customer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Customer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContactInfo. */ + interface IContactInfo { + + /** ContactInfo firstName */ + firstName?: (string|null); + + /** ContactInfo lastName */ + lastName?: (string|null); + + /** ContactInfo displayName */ + displayName?: (string|null); + + /** ContactInfo email */ + email?: (string|null); + + /** ContactInfo title */ + title?: (string|null); + + /** ContactInfo phone */ + phone?: (string|null); + } + + /** Represents a ContactInfo. */ + class ContactInfo implements IContactInfo { + + /** + * Constructs a new ContactInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IContactInfo); + + /** ContactInfo firstName. */ + public firstName: string; + + /** ContactInfo lastName. */ + public lastName: string; + + /** ContactInfo displayName. */ + public displayName: string; + + /** ContactInfo email. */ + public email: string; + + /** ContactInfo title. */ + public title: string; + + /** ContactInfo phone. */ + public phone: string; + + /** + * Creates a new ContactInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ContactInfo instance + */ + public static create(properties?: google.cloud.channel.v1.IContactInfo): google.cloud.channel.v1.ContactInfo; + + /** + * Encodes the specified ContactInfo message. Does not implicitly {@link google.cloud.channel.v1.ContactInfo.verify|verify} messages. + * @param message ContactInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IContactInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContactInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ContactInfo.verify|verify} messages. + * @param message ContactInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IContactInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContactInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContactInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ContactInfo; + + /** + * Decodes a ContactInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContactInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ContactInfo; + + /** + * Verifies a ContactInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContactInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContactInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ContactInfo; + + /** + * Creates a plain object from a ContactInfo message. Also converts values to other types if specified. + * @param message ContactInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ContactInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContactInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContactInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entitlement. */ + interface IEntitlement { + + /** Entitlement name */ + name?: (string|null); + + /** Entitlement createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Entitlement updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Entitlement offer */ + offer?: (string|null); + + /** Entitlement commitmentSettings */ + commitmentSettings?: (google.cloud.channel.v1.ICommitmentSettings|null); + + /** Entitlement provisioningState */ + provisioningState?: (google.cloud.channel.v1.Entitlement.ProvisioningState|keyof typeof google.cloud.channel.v1.Entitlement.ProvisioningState|null); + + /** Entitlement provisionedService */ + provisionedService?: (google.cloud.channel.v1.IProvisionedService|null); + + /** Entitlement suspensionReasons */ + suspensionReasons?: (google.cloud.channel.v1.Entitlement.SuspensionReason[]|null); + + /** Entitlement purchaseOrderId */ + purchaseOrderId?: (string|null); + + /** Entitlement trialSettings */ + trialSettings?: (google.cloud.channel.v1.ITrialSettings|null); + + /** Entitlement associationInfo */ + associationInfo?: (google.cloud.channel.v1.IAssociationInfo|null); + + /** Entitlement parameters */ + parameters?: (google.cloud.channel.v1.IParameter[]|null); + } + + /** Represents an Entitlement. */ + class Entitlement implements IEntitlement { + + /** + * Constructs a new Entitlement. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IEntitlement); + + /** Entitlement name. */ + public name: string; + + /** Entitlement createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Entitlement updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Entitlement offer. */ + public offer: string; + + /** Entitlement commitmentSettings. */ + public commitmentSettings?: (google.cloud.channel.v1.ICommitmentSettings|null); + + /** Entitlement provisioningState. */ + public provisioningState: (google.cloud.channel.v1.Entitlement.ProvisioningState|keyof typeof google.cloud.channel.v1.Entitlement.ProvisioningState); + + /** Entitlement provisionedService. */ + public provisionedService?: (google.cloud.channel.v1.IProvisionedService|null); + + /** Entitlement suspensionReasons. */ + public suspensionReasons: google.cloud.channel.v1.Entitlement.SuspensionReason[]; + + /** Entitlement purchaseOrderId. */ + public purchaseOrderId: string; + + /** Entitlement trialSettings. */ + public trialSettings?: (google.cloud.channel.v1.ITrialSettings|null); + + /** Entitlement associationInfo. */ + public associationInfo?: (google.cloud.channel.v1.IAssociationInfo|null); + + /** Entitlement parameters. */ + public parameters: google.cloud.channel.v1.IParameter[]; + + /** + * Creates a new Entitlement instance using the specified properties. + * @param [properties] Properties to set + * @returns Entitlement instance + */ + public static create(properties?: google.cloud.channel.v1.IEntitlement): google.cloud.channel.v1.Entitlement; + + /** + * Encodes the specified Entitlement message. Does not implicitly {@link google.cloud.channel.v1.Entitlement.verify|verify} messages. + * @param message Entitlement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IEntitlement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entitlement message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Entitlement.verify|verify} messages. + * @param message Entitlement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IEntitlement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entitlement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entitlement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Entitlement; + + /** + * Decodes an Entitlement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entitlement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Entitlement; + + /** + * Verifies an Entitlement message. + * @param message Plain 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 Entitlement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entitlement + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Entitlement; + + /** + * Creates a plain object from an Entitlement message. Also converts values to other types if specified. + * @param message Entitlement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Entitlement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entitlement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entitlement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Entitlement { + + /** ProvisioningState enum. */ + enum ProvisioningState { + PROVISIONING_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + SUSPENDED = 5 + } + + /** SuspensionReason enum. */ + enum SuspensionReason { + SUSPENSION_REASON_UNSPECIFIED = 0, + RESELLER_INITIATED = 1, + TRIAL_ENDED = 2, + RENEWAL_WITH_TYPE_CANCEL = 3, + PENDING_TOS_ACCEPTANCE = 4, + OTHER = 100 + } + } + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter name */ + name?: (string|null); + + /** Parameter value */ + value?: (google.cloud.channel.v1.IValue|null); + + /** Parameter editable */ + editable?: (boolean|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IParameter); + + /** Parameter name. */ + public name: string; + + /** Parameter value. */ + public value?: (google.cloud.channel.v1.IValue|null); + + /** Parameter editable. */ + public editable: boolean; + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.cloud.channel.v1.IParameter): google.cloud.channel.v1.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.channel.v1.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Parameter; + + /** + * Verifies a Parameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssociationInfo. */ + interface IAssociationInfo { + + /** AssociationInfo baseEntitlement */ + baseEntitlement?: (string|null); + } + + /** Represents an AssociationInfo. */ + class AssociationInfo implements IAssociationInfo { + + /** + * Constructs a new AssociationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IAssociationInfo); + + /** AssociationInfo baseEntitlement. */ + public baseEntitlement: string; + + /** + * Creates a new AssociationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns AssociationInfo instance + */ + public static create(properties?: google.cloud.channel.v1.IAssociationInfo): google.cloud.channel.v1.AssociationInfo; + + /** + * Encodes the specified AssociationInfo message. Does not implicitly {@link google.cloud.channel.v1.AssociationInfo.verify|verify} messages. + * @param message AssociationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IAssociationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssociationInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.AssociationInfo.verify|verify} messages. + * @param message AssociationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IAssociationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssociationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssociationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.AssociationInfo; + + /** + * Decodes an AssociationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssociationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.AssociationInfo; + + /** + * Verifies an AssociationInfo message. + * @param message Plain 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 AssociationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssociationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.AssociationInfo; + + /** + * Creates a plain object from an AssociationInfo message. Also converts values to other types if specified. + * @param message AssociationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.AssociationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssociationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssociationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProvisionedService. */ + interface IProvisionedService { + + /** ProvisionedService provisioningId */ + provisioningId?: (string|null); + + /** ProvisionedService productId */ + productId?: (string|null); + + /** ProvisionedService skuId */ + skuId?: (string|null); + } + + /** Represents a ProvisionedService. */ + class ProvisionedService implements IProvisionedService { + + /** + * Constructs a new ProvisionedService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IProvisionedService); + + /** ProvisionedService provisioningId. */ + public provisioningId: string; + + /** ProvisionedService productId. */ + public productId: string; + + /** ProvisionedService skuId. */ + public skuId: string; + + /** + * Creates a new ProvisionedService instance using the specified properties. + * @param [properties] Properties to set + * @returns ProvisionedService instance + */ + public static create(properties?: google.cloud.channel.v1.IProvisionedService): google.cloud.channel.v1.ProvisionedService; + + /** + * Encodes the specified ProvisionedService message. Does not implicitly {@link google.cloud.channel.v1.ProvisionedService.verify|verify} messages. + * @param message ProvisionedService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IProvisionedService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProvisionedService message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ProvisionedService.verify|verify} messages. + * @param message ProvisionedService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IProvisionedService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProvisionedService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProvisionedService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ProvisionedService; + + /** + * Decodes a ProvisionedService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProvisionedService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ProvisionedService; + + /** + * Verifies a ProvisionedService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProvisionedService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProvisionedService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ProvisionedService; + + /** + * Creates a plain object from a ProvisionedService message. Also converts values to other types if specified. + * @param message ProvisionedService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ProvisionedService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProvisionedService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProvisionedService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommitmentSettings. */ + interface ICommitmentSettings { + + /** CommitmentSettings startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** CommitmentSettings endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CommitmentSettings renewalSettings */ + renewalSettings?: (google.cloud.channel.v1.IRenewalSettings|null); + } + + /** Represents a CommitmentSettings. */ + class CommitmentSettings implements ICommitmentSettings { + + /** + * Constructs a new CommitmentSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICommitmentSettings); + + /** CommitmentSettings startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** CommitmentSettings endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CommitmentSettings renewalSettings. */ + public renewalSettings?: (google.cloud.channel.v1.IRenewalSettings|null); + + /** + * Creates a new CommitmentSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitmentSettings instance + */ + public static create(properties?: google.cloud.channel.v1.ICommitmentSettings): google.cloud.channel.v1.CommitmentSettings; + + /** + * Encodes the specified CommitmentSettings message. Does not implicitly {@link google.cloud.channel.v1.CommitmentSettings.verify|verify} messages. + * @param message CommitmentSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICommitmentSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitmentSettings message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CommitmentSettings.verify|verify} messages. + * @param message CommitmentSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICommitmentSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitmentSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CommitmentSettings; + + /** + * Decodes a CommitmentSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CommitmentSettings; + + /** + * Verifies a CommitmentSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitmentSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitmentSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CommitmentSettings; + + /** + * Creates a plain object from a CommitmentSettings message. Also converts values to other types if specified. + * @param message CommitmentSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CommitmentSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitmentSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommitmentSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RenewalSettings. */ + interface IRenewalSettings { + + /** RenewalSettings enableRenewal */ + enableRenewal?: (boolean|null); + + /** RenewalSettings resizeUnitCount */ + resizeUnitCount?: (boolean|null); + + /** RenewalSettings paymentPlan */ + paymentPlan?: (google.cloud.channel.v1.PaymentPlan|keyof typeof google.cloud.channel.v1.PaymentPlan|null); + + /** RenewalSettings paymentCycle */ + paymentCycle?: (google.cloud.channel.v1.IPeriod|null); + } + + /** Represents a RenewalSettings. */ + class RenewalSettings implements IRenewalSettings { + + /** + * Constructs a new RenewalSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRenewalSettings); + + /** RenewalSettings enableRenewal. */ + public enableRenewal: boolean; + + /** RenewalSettings resizeUnitCount. */ + public resizeUnitCount: boolean; + + /** RenewalSettings paymentPlan. */ + public paymentPlan: (google.cloud.channel.v1.PaymentPlan|keyof typeof google.cloud.channel.v1.PaymentPlan); + + /** RenewalSettings paymentCycle. */ + public paymentCycle?: (google.cloud.channel.v1.IPeriod|null); + + /** + * Creates a new RenewalSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RenewalSettings instance + */ + public static create(properties?: google.cloud.channel.v1.IRenewalSettings): google.cloud.channel.v1.RenewalSettings; + + /** + * Encodes the specified RenewalSettings message. Does not implicitly {@link google.cloud.channel.v1.RenewalSettings.verify|verify} messages. + * @param message RenewalSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRenewalSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RenewalSettings message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RenewalSettings.verify|verify} messages. + * @param message RenewalSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRenewalSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RenewalSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RenewalSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RenewalSettings; + + /** + * Decodes a RenewalSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RenewalSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RenewalSettings; + + /** + * Verifies a RenewalSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RenewalSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RenewalSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RenewalSettings; + + /** + * Creates a plain object from a RenewalSettings message. Also converts values to other types if specified. + * @param message RenewalSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RenewalSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RenewalSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RenewalSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrialSettings. */ + interface ITrialSettings { + + /** TrialSettings trial */ + trial?: (boolean|null); + + /** TrialSettings endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TrialSettings. */ + class TrialSettings implements ITrialSettings { + + /** + * Constructs a new TrialSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITrialSettings); + + /** TrialSettings trial. */ + public trial: boolean; + + /** TrialSettings endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TrialSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialSettings instance + */ + public static create(properties?: google.cloud.channel.v1.ITrialSettings): google.cloud.channel.v1.TrialSettings; + + /** + * Encodes the specified TrialSettings message. Does not implicitly {@link google.cloud.channel.v1.TrialSettings.verify|verify} messages. + * @param message TrialSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITrialSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialSettings message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TrialSettings.verify|verify} messages. + * @param message TrialSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITrialSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TrialSettings; + + /** + * Decodes a TrialSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TrialSettings; + + /** + * Verifies a TrialSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TrialSettings; + + /** + * Creates a plain object from a TrialSettings message. Also converts values to other types if specified. + * @param message TrialSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TrialSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferableSku. */ + interface ITransferableSku { + + /** TransferableSku transferEligibility */ + transferEligibility?: (google.cloud.channel.v1.ITransferEligibility|null); + + /** TransferableSku sku */ + sku?: (google.cloud.channel.v1.ISku|null); + + /** TransferableSku legacySku */ + legacySku?: (google.cloud.channel.v1.ISku|null); + } + + /** Represents a TransferableSku. */ + class TransferableSku implements ITransferableSku { + + /** + * Constructs a new TransferableSku. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITransferableSku); + + /** TransferableSku transferEligibility. */ + public transferEligibility?: (google.cloud.channel.v1.ITransferEligibility|null); + + /** TransferableSku sku. */ + public sku?: (google.cloud.channel.v1.ISku|null); + + /** TransferableSku legacySku. */ + public legacySku?: (google.cloud.channel.v1.ISku|null); + + /** + * Creates a new TransferableSku instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferableSku instance + */ + public static create(properties?: google.cloud.channel.v1.ITransferableSku): google.cloud.channel.v1.TransferableSku; + + /** + * Encodes the specified TransferableSku message. Does not implicitly {@link google.cloud.channel.v1.TransferableSku.verify|verify} messages. + * @param message TransferableSku message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITransferableSku, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferableSku message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferableSku.verify|verify} messages. + * @param message TransferableSku message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITransferableSku, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferableSku message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TransferableSku; + + /** + * Decodes a TransferableSku message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TransferableSku; + + /** + * Verifies a TransferableSku message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferableSku message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferableSku + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TransferableSku; + + /** + * Creates a plain object from a TransferableSku message. Also converts values to other types if specified. + * @param message TransferableSku + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TransferableSku, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferableSku to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferableSku + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferEligibility. */ + interface ITransferEligibility { + + /** TransferEligibility isEligible */ + isEligible?: (boolean|null); + + /** TransferEligibility description */ + description?: (string|null); + + /** TransferEligibility ineligibilityReason */ + ineligibilityReason?: (google.cloud.channel.v1.TransferEligibility.Reason|keyof typeof google.cloud.channel.v1.TransferEligibility.Reason|null); + } + + /** Represents a TransferEligibility. */ + class TransferEligibility implements ITransferEligibility { + + /** + * Constructs a new TransferEligibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITransferEligibility); + + /** TransferEligibility isEligible. */ + public isEligible: boolean; + + /** TransferEligibility description. */ + public description: string; + + /** TransferEligibility ineligibilityReason. */ + public ineligibilityReason: (google.cloud.channel.v1.TransferEligibility.Reason|keyof typeof google.cloud.channel.v1.TransferEligibility.Reason); + + /** + * Creates a new TransferEligibility instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferEligibility instance + */ + public static create(properties?: google.cloud.channel.v1.ITransferEligibility): google.cloud.channel.v1.TransferEligibility; + + /** + * Encodes the specified TransferEligibility message. Does not implicitly {@link google.cloud.channel.v1.TransferEligibility.verify|verify} messages. + * @param message TransferEligibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITransferEligibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferEligibility message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEligibility.verify|verify} messages. + * @param message TransferEligibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITransferEligibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferEligibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TransferEligibility; + + /** + * Decodes a TransferEligibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TransferEligibility; + + /** + * Verifies a TransferEligibility message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferEligibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferEligibility + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TransferEligibility; + + /** + * Creates a plain object from a TransferEligibility message. Also converts values to other types if specified. + * @param message TransferEligibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TransferEligibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferEligibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferEligibility + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransferEligibility { + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + PENDING_TOS_ACCEPTANCE = 1, + SKU_NOT_ELIGIBLE = 2, + SKU_SUSPENDED = 3 + } + } + + /** PromotionalOrderType enum. */ + enum PromotionalOrderType { + PROMOTIONAL_TYPE_UNSPECIFIED = 0, + NEW_UPGRADE = 1, + TRANSFER = 2, + PROMOTION_SWITCH = 3 + } + + /** PaymentPlan enum. */ + enum PaymentPlan { + PAYMENT_PLAN_UNSPECIFIED = 0, + COMMITMENT = 1, + FLEXIBLE = 2, + FREE = 3, + TRIAL = 4, + OFFLINE = 5 + } + + /** PaymentType enum. */ + enum PaymentType { + PAYMENT_TYPE_UNSPECIFIED = 0, + PREPAY = 1, + POSTPAY = 2 + } + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + SEAT = 1, + MAU = 2, + GB = 3, + LICENSED_USER = 4, + MINUTES = 5, + IAAS_USAGE = 6, + SUBSCRIPTION = 7 + } + + /** PeriodType enum. */ + enum PeriodType { + PERIOD_TYPE_UNSPECIFIED = 0, + DAY = 1, + MONTH = 2, + YEAR = 3 + } + + /** Properties of an Offer. */ + interface IOffer { + + /** Offer name */ + name?: (string|null); + + /** Offer marketingInfo */ + marketingInfo?: (google.cloud.channel.v1.IMarketingInfo|null); + + /** Offer sku */ + sku?: (google.cloud.channel.v1.ISku|null); + + /** Offer plan */ + plan?: (google.cloud.channel.v1.IPlan|null); + + /** Offer constraints */ + constraints?: (google.cloud.channel.v1.IConstraints|null); + + /** Offer priceByResources */ + priceByResources?: (google.cloud.channel.v1.IPriceByResource[]|null); + + /** Offer startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Offer endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Offer parameterDefinitions */ + parameterDefinitions?: (google.cloud.channel.v1.IParameterDefinition[]|null); + + /** Offer dealCode */ + dealCode?: (string|null); + } + + /** Represents an Offer. */ + class Offer implements IOffer { + + /** + * Constructs a new Offer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IOffer); + + /** Offer name. */ + public name: string; + + /** Offer marketingInfo. */ + public marketingInfo?: (google.cloud.channel.v1.IMarketingInfo|null); + + /** Offer sku. */ + public sku?: (google.cloud.channel.v1.ISku|null); + + /** Offer plan. */ + public plan?: (google.cloud.channel.v1.IPlan|null); + + /** Offer constraints. */ + public constraints?: (google.cloud.channel.v1.IConstraints|null); + + /** Offer priceByResources. */ + public priceByResources: google.cloud.channel.v1.IPriceByResource[]; + + /** Offer startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Offer endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Offer parameterDefinitions. */ + public parameterDefinitions: google.cloud.channel.v1.IParameterDefinition[]; + + /** Offer dealCode. */ + public dealCode: string; + + /** + * Creates a new Offer instance using the specified properties. + * @param [properties] Properties to set + * @returns Offer instance + */ + public static create(properties?: google.cloud.channel.v1.IOffer): google.cloud.channel.v1.Offer; + + /** + * Encodes the specified Offer message. Does not implicitly {@link google.cloud.channel.v1.Offer.verify|verify} messages. + * @param message Offer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IOffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Offer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Offer.verify|verify} messages. + * @param message Offer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IOffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Offer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Offer; + + /** + * Decodes an Offer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Offer; + + /** + * Verifies an Offer message. + * @param message Plain 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 Offer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Offer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Offer; + + /** + * Creates a plain object from an Offer message. Also converts values to other types if specified. + * @param message Offer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Offer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Offer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Offer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ParameterDefinition. */ + interface IParameterDefinition { + + /** ParameterDefinition name */ + name?: (string|null); + + /** ParameterDefinition parameterType */ + parameterType?: (google.cloud.channel.v1.ParameterDefinition.ParameterType|keyof typeof google.cloud.channel.v1.ParameterDefinition.ParameterType|null); + + /** ParameterDefinition minValue */ + minValue?: (google.cloud.channel.v1.IValue|null); + + /** ParameterDefinition maxValue */ + maxValue?: (google.cloud.channel.v1.IValue|null); + + /** ParameterDefinition allowedValues */ + allowedValues?: (google.cloud.channel.v1.IValue[]|null); + + /** ParameterDefinition optional */ + optional?: (boolean|null); + } + + /** Represents a ParameterDefinition. */ + class ParameterDefinition implements IParameterDefinition { + + /** + * Constructs a new ParameterDefinition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IParameterDefinition); + + /** ParameterDefinition name. */ + public name: string; + + /** ParameterDefinition parameterType. */ + public parameterType: (google.cloud.channel.v1.ParameterDefinition.ParameterType|keyof typeof google.cloud.channel.v1.ParameterDefinition.ParameterType); + + /** ParameterDefinition minValue. */ + public minValue?: (google.cloud.channel.v1.IValue|null); + + /** ParameterDefinition maxValue. */ + public maxValue?: (google.cloud.channel.v1.IValue|null); + + /** ParameterDefinition allowedValues. */ + public allowedValues: google.cloud.channel.v1.IValue[]; + + /** ParameterDefinition optional. */ + public optional: boolean; + + /** + * Creates a new ParameterDefinition instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterDefinition instance + */ + public static create(properties?: google.cloud.channel.v1.IParameterDefinition): google.cloud.channel.v1.ParameterDefinition; + + /** + * Encodes the specified ParameterDefinition message. Does not implicitly {@link google.cloud.channel.v1.ParameterDefinition.verify|verify} messages. + * @param message ParameterDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IParameterDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterDefinition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ParameterDefinition.verify|verify} messages. + * @param message ParameterDefinition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IParameterDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ParameterDefinition; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ParameterDefinition; + + /** + * Verifies a ParameterDefinition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ParameterDefinition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterDefinition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ParameterDefinition; + + /** + * Creates a plain object from a ParameterDefinition message. Also converts values to other types if specified. + * @param message ParameterDefinition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ParameterDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterDefinition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterDefinition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ParameterDefinition { + + /** ParameterType enum. */ + enum ParameterType { + PARAMETER_TYPE_UNSPECIFIED = 0, + INT64 = 1, + STRING = 2, + DOUBLE = 3 + } + } + + /** Properties of a Constraints. */ + interface IConstraints { + + /** Constraints customerConstraints */ + customerConstraints?: (google.cloud.channel.v1.ICustomerConstraints|null); + } + + /** Represents a Constraints. */ + class Constraints implements IConstraints { + + /** + * Constructs a new Constraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IConstraints); + + /** Constraints customerConstraints. */ + public customerConstraints?: (google.cloud.channel.v1.ICustomerConstraints|null); + + /** + * Creates a new Constraints instance using the specified properties. + * @param [properties] Properties to set + * @returns Constraints instance + */ + public static create(properties?: google.cloud.channel.v1.IConstraints): google.cloud.channel.v1.Constraints; + + /** + * Encodes the specified Constraints message. Does not implicitly {@link google.cloud.channel.v1.Constraints.verify|verify} messages. + * @param message Constraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Constraints message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Constraints.verify|verify} messages. + * @param message Constraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Constraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Constraints; + + /** + * Decodes a Constraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Constraints; + + /** + * Verifies a Constraints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Constraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Constraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Constraints; + + /** + * Creates a plain object from a Constraints message. Also converts values to other types if specified. + * @param message Constraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Constraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Constraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Constraints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerConstraints. */ + interface ICustomerConstraints { + + /** CustomerConstraints allowedRegions */ + allowedRegions?: (string[]|null); + + /** CustomerConstraints allowedCustomerTypes */ + allowedCustomerTypes?: (google.cloud.channel.v1.CloudIdentityInfo.CustomerType[]|null); + + /** CustomerConstraints promotionalOrderTypes */ + promotionalOrderTypes?: (google.cloud.channel.v1.PromotionalOrderType[]|null); + } + + /** Represents a CustomerConstraints. */ + class CustomerConstraints implements ICustomerConstraints { + + /** + * Constructs a new CustomerConstraints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICustomerConstraints); + + /** CustomerConstraints allowedRegions. */ + public allowedRegions: string[]; + + /** CustomerConstraints allowedCustomerTypes. */ + public allowedCustomerTypes: google.cloud.channel.v1.CloudIdentityInfo.CustomerType[]; + + /** CustomerConstraints promotionalOrderTypes. */ + public promotionalOrderTypes: google.cloud.channel.v1.PromotionalOrderType[]; + + /** + * Creates a new CustomerConstraints instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerConstraints instance + */ + public static create(properties?: google.cloud.channel.v1.ICustomerConstraints): google.cloud.channel.v1.CustomerConstraints; + + /** + * Encodes the specified CustomerConstraints message. Does not implicitly {@link google.cloud.channel.v1.CustomerConstraints.verify|verify} messages. + * @param message CustomerConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICustomerConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerConstraints message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CustomerConstraints.verify|verify} messages. + * @param message CustomerConstraints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICustomerConstraints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerConstraints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CustomerConstraints; + + /** + * Decodes a CustomerConstraints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CustomerConstraints; + + /** + * Verifies a CustomerConstraints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerConstraints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerConstraints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CustomerConstraints; + + /** + * Creates a plain object from a CustomerConstraints message. Also converts values to other types if specified. + * @param message CustomerConstraints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CustomerConstraints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerConstraints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerConstraints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Plan. */ + interface IPlan { + + /** Plan paymentPlan */ + paymentPlan?: (google.cloud.channel.v1.PaymentPlan|keyof typeof google.cloud.channel.v1.PaymentPlan|null); + + /** Plan paymentType */ + paymentType?: (google.cloud.channel.v1.PaymentType|keyof typeof google.cloud.channel.v1.PaymentType|null); + + /** Plan paymentCycle */ + paymentCycle?: (google.cloud.channel.v1.IPeriod|null); + + /** Plan trialPeriod */ + trialPeriod?: (google.cloud.channel.v1.IPeriod|null); + + /** Plan billingAccount */ + billingAccount?: (string|null); + } + + /** Represents a Plan. */ + class Plan implements IPlan { + + /** + * Constructs a new Plan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPlan); + + /** Plan paymentPlan. */ + public paymentPlan: (google.cloud.channel.v1.PaymentPlan|keyof typeof google.cloud.channel.v1.PaymentPlan); + + /** Plan paymentType. */ + public paymentType: (google.cloud.channel.v1.PaymentType|keyof typeof google.cloud.channel.v1.PaymentType); + + /** Plan paymentCycle. */ + public paymentCycle?: (google.cloud.channel.v1.IPeriod|null); + + /** Plan trialPeriod. */ + public trialPeriod?: (google.cloud.channel.v1.IPeriod|null); + + /** Plan billingAccount. */ + public billingAccount: string; + + /** + * Creates a new Plan instance using the specified properties. + * @param [properties] Properties to set + * @returns Plan instance + */ + public static create(properties?: google.cloud.channel.v1.IPlan): google.cloud.channel.v1.Plan; + + /** + * Encodes the specified Plan message. Does not implicitly {@link google.cloud.channel.v1.Plan.verify|verify} messages. + * @param message Plan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Plan message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Plan.verify|verify} messages. + * @param message Plan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Plan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Plan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Plan; + + /** + * Decodes a Plan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Plan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Plan; + + /** + * Verifies a Plan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Plan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Plan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Plan; + + /** + * Creates a plain object from a Plan message. Also converts values to other types if specified. + * @param message Plan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Plan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Plan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Plan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PriceByResource. */ + interface IPriceByResource { + + /** PriceByResource resourceType */ + resourceType?: (google.cloud.channel.v1.ResourceType|keyof typeof google.cloud.channel.v1.ResourceType|null); + + /** PriceByResource price */ + price?: (google.cloud.channel.v1.IPrice|null); + + /** PriceByResource pricePhases */ + pricePhases?: (google.cloud.channel.v1.IPricePhase[]|null); + } + + /** Represents a PriceByResource. */ + class PriceByResource implements IPriceByResource { + + /** + * Constructs a new PriceByResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPriceByResource); + + /** PriceByResource resourceType. */ + public resourceType: (google.cloud.channel.v1.ResourceType|keyof typeof google.cloud.channel.v1.ResourceType); + + /** PriceByResource price. */ + public price?: (google.cloud.channel.v1.IPrice|null); + + /** PriceByResource pricePhases. */ + public pricePhases: google.cloud.channel.v1.IPricePhase[]; + + /** + * Creates a new PriceByResource instance using the specified properties. + * @param [properties] Properties to set + * @returns PriceByResource instance + */ + public static create(properties?: google.cloud.channel.v1.IPriceByResource): google.cloud.channel.v1.PriceByResource; + + /** + * Encodes the specified PriceByResource message. Does not implicitly {@link google.cloud.channel.v1.PriceByResource.verify|verify} messages. + * @param message PriceByResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPriceByResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PriceByResource message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PriceByResource.verify|verify} messages. + * @param message PriceByResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPriceByResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PriceByResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PriceByResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.PriceByResource; + + /** + * Decodes a PriceByResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PriceByResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.PriceByResource; + + /** + * Verifies a PriceByResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PriceByResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PriceByResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.PriceByResource; + + /** + * Creates a plain object from a PriceByResource message. Also converts values to other types if specified. + * @param message PriceByResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.PriceByResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PriceByResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PriceByResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Price. */ + interface IPrice { + + /** Price basePrice */ + basePrice?: (google.type.IMoney|null); + + /** Price discount */ + discount?: (number|null); + + /** Price effectivePrice */ + effectivePrice?: (google.type.IMoney|null); + + /** Price externalPriceUri */ + externalPriceUri?: (string|null); + } + + /** Represents a Price. */ + class Price implements IPrice { + + /** + * Constructs a new Price. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPrice); + + /** Price basePrice. */ + public basePrice?: (google.type.IMoney|null); + + /** Price discount. */ + public discount: number; + + /** Price effectivePrice. */ + public effectivePrice?: (google.type.IMoney|null); + + /** Price externalPriceUri. */ + public externalPriceUri: string; + + /** + * Creates a new Price instance using the specified properties. + * @param [properties] Properties to set + * @returns Price instance + */ + public static create(properties?: google.cloud.channel.v1.IPrice): google.cloud.channel.v1.Price; + + /** + * Encodes the specified Price message. Does not implicitly {@link google.cloud.channel.v1.Price.verify|verify} messages. + * @param message Price message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPrice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Price message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Price.verify|verify} messages. + * @param message Price message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPrice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Price message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Price; + + /** + * Decodes a Price message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Price; + + /** + * Verifies a Price message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Price message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Price + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Price; + + /** + * Creates a plain object from a Price message. Also converts values to other types if specified. + * @param message Price + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Price, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Price to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Price + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PricePhase. */ + interface IPricePhase { + + /** PricePhase periodType */ + periodType?: (google.cloud.channel.v1.PeriodType|keyof typeof google.cloud.channel.v1.PeriodType|null); + + /** PricePhase firstPeriod */ + firstPeriod?: (number|null); + + /** PricePhase lastPeriod */ + lastPeriod?: (number|null); + + /** PricePhase price */ + price?: (google.cloud.channel.v1.IPrice|null); + + /** PricePhase priceTiers */ + priceTiers?: (google.cloud.channel.v1.IPriceTier[]|null); + } + + /** Represents a PricePhase. */ + class PricePhase implements IPricePhase { + + /** + * Constructs a new PricePhase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPricePhase); + + /** PricePhase periodType. */ + public periodType: (google.cloud.channel.v1.PeriodType|keyof typeof google.cloud.channel.v1.PeriodType); + + /** PricePhase firstPeriod. */ + public firstPeriod: number; + + /** PricePhase lastPeriod. */ + public lastPeriod: number; + + /** PricePhase price. */ + public price?: (google.cloud.channel.v1.IPrice|null); + + /** PricePhase priceTiers. */ + public priceTiers: google.cloud.channel.v1.IPriceTier[]; + + /** + * Creates a new PricePhase instance using the specified properties. + * @param [properties] Properties to set + * @returns PricePhase instance + */ + public static create(properties?: google.cloud.channel.v1.IPricePhase): google.cloud.channel.v1.PricePhase; + + /** + * Encodes the specified PricePhase message. Does not implicitly {@link google.cloud.channel.v1.PricePhase.verify|verify} messages. + * @param message PricePhase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPricePhase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PricePhase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PricePhase.verify|verify} messages. + * @param message PricePhase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPricePhase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PricePhase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PricePhase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.PricePhase; + + /** + * Decodes a PricePhase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PricePhase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.PricePhase; + + /** + * Verifies a PricePhase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PricePhase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PricePhase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.PricePhase; + + /** + * Creates a plain object from a PricePhase message. Also converts values to other types if specified. + * @param message PricePhase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.PricePhase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PricePhase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PricePhase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PriceTier. */ + interface IPriceTier { + + /** PriceTier firstResource */ + firstResource?: (number|null); + + /** PriceTier lastResource */ + lastResource?: (number|null); + + /** PriceTier price */ + price?: (google.cloud.channel.v1.IPrice|null); + } + + /** Represents a PriceTier. */ + class PriceTier implements IPriceTier { + + /** + * Constructs a new PriceTier. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPriceTier); + + /** PriceTier firstResource. */ + public firstResource: number; + + /** PriceTier lastResource. */ + public lastResource: number; + + /** PriceTier price. */ + public price?: (google.cloud.channel.v1.IPrice|null); + + /** + * Creates a new PriceTier instance using the specified properties. + * @param [properties] Properties to set + * @returns PriceTier instance + */ + public static create(properties?: google.cloud.channel.v1.IPriceTier): google.cloud.channel.v1.PriceTier; + + /** + * Encodes the specified PriceTier message. Does not implicitly {@link google.cloud.channel.v1.PriceTier.verify|verify} messages. + * @param message PriceTier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPriceTier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PriceTier message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PriceTier.verify|verify} messages. + * @param message PriceTier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPriceTier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PriceTier message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PriceTier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.PriceTier; + + /** + * Decodes a PriceTier message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PriceTier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.PriceTier; + + /** + * Verifies a PriceTier message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PriceTier message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PriceTier + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.PriceTier; + + /** + * Creates a plain object from a PriceTier message. Also converts values to other types if specified. + * @param message PriceTier + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.PriceTier, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PriceTier to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PriceTier + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Period. */ + interface IPeriod { + + /** Period duration */ + duration?: (number|null); + + /** Period periodType */ + periodType?: (google.cloud.channel.v1.PeriodType|keyof typeof google.cloud.channel.v1.PeriodType|null); + } + + /** Represents a Period. */ + class Period implements IPeriod { + + /** + * Constructs a new Period. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPeriod); + + /** Period duration. */ + public duration: number; + + /** Period periodType. */ + public periodType: (google.cloud.channel.v1.PeriodType|keyof typeof google.cloud.channel.v1.PeriodType); + + /** + * Creates a new Period instance using the specified properties. + * @param [properties] Properties to set + * @returns Period instance + */ + public static create(properties?: google.cloud.channel.v1.IPeriod): google.cloud.channel.v1.Period; + + /** + * Encodes the specified Period message. Does not implicitly {@link google.cloud.channel.v1.Period.verify|verify} messages. + * @param message Period message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Period message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Period.verify|verify} messages. + * @param message Period message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPeriod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Period message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Period + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Period; + + /** + * Decodes a Period message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Period + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Period; + + /** + * Verifies a Period message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Period message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Period + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Period; + + /** + * Creates a plain object from a Period message. Also converts values to other types if specified. + * @param message Period + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Period, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Period to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Period + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MediaType enum. */ + enum MediaType { + MEDIA_TYPE_UNSPECIFIED = 0, + MEDIA_TYPE_IMAGE = 1 + } + + /** Properties of a Product. */ + interface IProduct { + + /** Product name */ + name?: (string|null); + + /** Product marketingInfo */ + marketingInfo?: (google.cloud.channel.v1.IMarketingInfo|null); + } + + /** Represents a Product. */ + class Product implements IProduct { + + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IProduct); + + /** Product name. */ + public name: string; + + /** Product marketingInfo. */ + public marketingInfo?: (google.cloud.channel.v1.IMarketingInfo|null); + + /** + * Creates a new Product instance using the specified properties. + * @param [properties] Properties to set + * @returns Product instance + */ + public static create(properties?: google.cloud.channel.v1.IProduct): google.cloud.channel.v1.Product; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.channel.v1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Product.verify|verify} messages. + * @param message Product message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Product message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Product; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Product; + + /** + * Verifies a Product message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Product + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Product; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Product to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Product + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Sku. */ + interface ISku { + + /** Sku name */ + name?: (string|null); + + /** Sku marketingInfo */ + marketingInfo?: (google.cloud.channel.v1.IMarketingInfo|null); + + /** Sku product */ + product?: (google.cloud.channel.v1.IProduct|null); + } + + /** Represents a Sku. */ + class Sku implements ISku { + + /** + * Constructs a new Sku. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ISku); + + /** Sku name. */ + public name: string; + + /** Sku marketingInfo. */ + public marketingInfo?: (google.cloud.channel.v1.IMarketingInfo|null); + + /** Sku product. */ + public product?: (google.cloud.channel.v1.IProduct|null); + + /** + * Creates a new Sku instance using the specified properties. + * @param [properties] Properties to set + * @returns Sku instance + */ + public static create(properties?: google.cloud.channel.v1.ISku): google.cloud.channel.v1.Sku; + + /** + * Encodes the specified Sku message. Does not implicitly {@link google.cloud.channel.v1.Sku.verify|verify} messages. + * @param message Sku message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ISku, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sku message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Sku.verify|verify} messages. + * @param message Sku message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ISku, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sku message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Sku; + + /** + * Decodes a Sku message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Sku; + + /** + * Verifies a Sku message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sku message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sku + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Sku; + + /** + * Creates a plain object from a Sku message. Also converts values to other types if specified. + * @param message Sku + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Sku, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sku to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Sku + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MarketingInfo. */ + interface IMarketingInfo { + + /** MarketingInfo displayName */ + displayName?: (string|null); + + /** MarketingInfo description */ + description?: (string|null); + + /** MarketingInfo defaultLogo */ + defaultLogo?: (google.cloud.channel.v1.IMedia|null); + } + + /** Represents a MarketingInfo. */ + class MarketingInfo implements IMarketingInfo { + + /** + * Constructs a new MarketingInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IMarketingInfo); + + /** MarketingInfo displayName. */ + public displayName: string; + + /** MarketingInfo description. */ + public description: string; + + /** MarketingInfo defaultLogo. */ + public defaultLogo?: (google.cloud.channel.v1.IMedia|null); + + /** + * Creates a new MarketingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MarketingInfo instance + */ + public static create(properties?: google.cloud.channel.v1.IMarketingInfo): google.cloud.channel.v1.MarketingInfo; + + /** + * Encodes the specified MarketingInfo message. Does not implicitly {@link google.cloud.channel.v1.MarketingInfo.verify|verify} messages. + * @param message MarketingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IMarketingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MarketingInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.MarketingInfo.verify|verify} messages. + * @param message MarketingInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IMarketingInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MarketingInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MarketingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.MarketingInfo; + + /** + * Decodes a MarketingInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MarketingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.MarketingInfo; + + /** + * Verifies a MarketingInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MarketingInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MarketingInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.MarketingInfo; + + /** + * Creates a plain object from a MarketingInfo message. Also converts values to other types if specified. + * @param message MarketingInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.MarketingInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MarketingInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MarketingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Media. */ + interface IMedia { + + /** Media title */ + title?: (string|null); + + /** Media content */ + content?: (string|null); + + /** Media type */ + type?: (google.cloud.channel.v1.MediaType|keyof typeof google.cloud.channel.v1.MediaType|null); + } + + /** Represents a Media. */ + class Media implements IMedia { + + /** + * Constructs a new Media. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IMedia); + + /** Media title. */ + public title: string; + + /** Media content. */ + public content: string; + + /** Media type. */ + public type: (google.cloud.channel.v1.MediaType|keyof typeof google.cloud.channel.v1.MediaType); + + /** + * Creates a new Media instance using the specified properties. + * @param [properties] Properties to set + * @returns Media instance + */ + public static create(properties?: google.cloud.channel.v1.IMedia): google.cloud.channel.v1.Media; + + /** + * Encodes the specified Media message. Does not implicitly {@link google.cloud.channel.v1.Media.verify|verify} messages. + * @param message Media message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IMedia, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Media message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Media.verify|verify} messages. + * @param message Media message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IMedia, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Media message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Media + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Media; + + /** + * Decodes a Media message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Media + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Media; + + /** + * Verifies a Media message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Media message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Media + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Media; + + /** + * Creates a plain object from a Media message. Also converts values to other types if specified. + * @param message Media + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Media, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Media to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Media + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata operationType */ + operationType?: (google.cloud.channel.v1.OperationMetadata.OperationType|keyof typeof google.cloud.channel.v1.OperationMetadata.OperationType|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IOperationMetadata); + + /** OperationMetadata operationType. */ + public operationType: (google.cloud.channel.v1.OperationMetadata.OperationType|keyof typeof google.cloud.channel.v1.OperationMetadata.OperationType); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.channel.v1.IOperationMetadata): google.cloud.channel.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.channel.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.channel.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.channel.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.channel.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.channel.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.channel.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.channel.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.channel.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OperationMetadata { + + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + CREATE_ENTITLEMENT = 1, + CHANGE_RENEWAL_SETTINGS = 3, + START_PAID_SERVICE = 5, + ACTIVATE_ENTITLEMENT = 7, + SUSPEND_ENTITLEMENT = 8, + CANCEL_ENTITLEMENT = 9, + TRANSFER_ENTITLEMENTS = 10, + TRANSFER_ENTITLEMENTS_TO_GOOGLE = 11, + CHANGE_OFFER = 14, + CHANGE_PARAMETERS = 15, + PROVISION_CLOUD_IDENTITY = 16 + } + } + + /** Represents a CloudChannelReportsService */ + class CloudChannelReportsService extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudChannelReportsService 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 CloudChannelReportsService 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): CloudChannelReportsService; + + /** + * Calls RunReportJob. + * @param request RunReportJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runReportJob(request: google.cloud.channel.v1.IRunReportJobRequest, callback: google.cloud.channel.v1.CloudChannelReportsService.RunReportJobCallback): void; + + /** + * Calls RunReportJob. + * @param request RunReportJobRequest message or plain object + * @returns Promise + */ + public runReportJob(request: google.cloud.channel.v1.IRunReportJobRequest): Promise; + + /** + * Calls FetchReportResults. + * @param request FetchReportResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchReportResultsResponse + */ + public fetchReportResults(request: google.cloud.channel.v1.IFetchReportResultsRequest, callback: google.cloud.channel.v1.CloudChannelReportsService.FetchReportResultsCallback): void; + + /** + * Calls FetchReportResults. + * @param request FetchReportResultsRequest message or plain object + * @returns Promise + */ + public fetchReportResults(request: google.cloud.channel.v1.IFetchReportResultsRequest): Promise; + + /** + * Calls ListReports. + * @param request ListReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReportsResponse + */ + public listReports(request: google.cloud.channel.v1.IListReportsRequest, callback: google.cloud.channel.v1.CloudChannelReportsService.ListReportsCallback): void; + + /** + * Calls ListReports. + * @param request ListReportsRequest message or plain object + * @returns Promise + */ + public listReports(request: google.cloud.channel.v1.IListReportsRequest): Promise; + } + + namespace CloudChannelReportsService { + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelReportsService|runReportJob}. + * @param error Error, if any + * @param [response] Operation + */ + type RunReportJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelReportsService|fetchReportResults}. + * @param error Error, if any + * @param [response] FetchReportResultsResponse + */ + type FetchReportResultsCallback = (error: (Error|null), response?: google.cloud.channel.v1.FetchReportResultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelReportsService|listReports}. + * @param error Error, if any + * @param [response] ListReportsResponse + */ + type ListReportsCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListReportsResponse) => void; + } + + /** Properties of a RunReportJobRequest. */ + interface IRunReportJobRequest { + + /** RunReportJobRequest name */ + name?: (string|null); + + /** RunReportJobRequest dateRange */ + dateRange?: (google.cloud.channel.v1.IDateRange|null); + + /** RunReportJobRequest filter */ + filter?: (string|null); + + /** RunReportJobRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a RunReportJobRequest. */ + class RunReportJobRequest implements IRunReportJobRequest { + + /** + * Constructs a new RunReportJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRunReportJobRequest); + + /** RunReportJobRequest name. */ + public name: string; + + /** RunReportJobRequest dateRange. */ + public dateRange?: (google.cloud.channel.v1.IDateRange|null); + + /** RunReportJobRequest filter. */ + public filter: string; + + /** RunReportJobRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new RunReportJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunReportJobRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IRunReportJobRequest): google.cloud.channel.v1.RunReportJobRequest; + + /** + * Encodes the specified RunReportJobRequest message. Does not implicitly {@link google.cloud.channel.v1.RunReportJobRequest.verify|verify} messages. + * @param message RunReportJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRunReportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunReportJobRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RunReportJobRequest.verify|verify} messages. + * @param message RunReportJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRunReportJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunReportJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunReportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RunReportJobRequest; + + /** + * Decodes a RunReportJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunReportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RunReportJobRequest; + + /** + * Verifies a RunReportJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunReportJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunReportJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RunReportJobRequest; + + /** + * Creates a plain object from a RunReportJobRequest message. Also converts values to other types if specified. + * @param message RunReportJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RunReportJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunReportJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunReportJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunReportJobResponse. */ + interface IRunReportJobResponse { + + /** RunReportJobResponse reportJob */ + reportJob?: (google.cloud.channel.v1.IReportJob|null); + + /** RunReportJobResponse reportMetadata */ + reportMetadata?: (google.cloud.channel.v1.IReportResultsMetadata|null); + } + + /** Represents a RunReportJobResponse. */ + class RunReportJobResponse implements IRunReportJobResponse { + + /** + * Constructs a new RunReportJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRunReportJobResponse); + + /** RunReportJobResponse reportJob. */ + public reportJob?: (google.cloud.channel.v1.IReportJob|null); + + /** RunReportJobResponse reportMetadata. */ + public reportMetadata?: (google.cloud.channel.v1.IReportResultsMetadata|null); + + /** + * Creates a new RunReportJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunReportJobResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IRunReportJobResponse): google.cloud.channel.v1.RunReportJobResponse; + + /** + * Encodes the specified RunReportJobResponse message. Does not implicitly {@link google.cloud.channel.v1.RunReportJobResponse.verify|verify} messages. + * @param message RunReportJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRunReportJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunReportJobResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RunReportJobResponse.verify|verify} messages. + * @param message RunReportJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRunReportJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunReportJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunReportJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RunReportJobResponse; + + /** + * Decodes a RunReportJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunReportJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RunReportJobResponse; + + /** + * Verifies a RunReportJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunReportJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunReportJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RunReportJobResponse; + + /** + * Creates a plain object from a RunReportJobResponse message. Also converts values to other types if specified. + * @param message RunReportJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RunReportJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunReportJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunReportJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchReportResultsRequest. */ + interface IFetchReportResultsRequest { + + /** FetchReportResultsRequest reportJob */ + reportJob?: (string|null); + + /** FetchReportResultsRequest pageSize */ + pageSize?: (number|null); + + /** FetchReportResultsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a FetchReportResultsRequest. */ + class FetchReportResultsRequest implements IFetchReportResultsRequest { + + /** + * Constructs a new FetchReportResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IFetchReportResultsRequest); + + /** FetchReportResultsRequest reportJob. */ + public reportJob: string; + + /** FetchReportResultsRequest pageSize. */ + public pageSize: number; + + /** FetchReportResultsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new FetchReportResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchReportResultsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IFetchReportResultsRequest): google.cloud.channel.v1.FetchReportResultsRequest; + + /** + * Encodes the specified FetchReportResultsRequest message. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsRequest.verify|verify} messages. + * @param message FetchReportResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IFetchReportResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchReportResultsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsRequest.verify|verify} messages. + * @param message FetchReportResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IFetchReportResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchReportResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchReportResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.FetchReportResultsRequest; + + /** + * Decodes a FetchReportResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchReportResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.FetchReportResultsRequest; + + /** + * Verifies a FetchReportResultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchReportResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchReportResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.FetchReportResultsRequest; + + /** + * Creates a plain object from a FetchReportResultsRequest message. Also converts values to other types if specified. + * @param message FetchReportResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.FetchReportResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchReportResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchReportResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchReportResultsResponse. */ + interface IFetchReportResultsResponse { + + /** FetchReportResultsResponse reportMetadata */ + reportMetadata?: (google.cloud.channel.v1.IReportResultsMetadata|null); + + /** FetchReportResultsResponse rows */ + rows?: (google.cloud.channel.v1.IRow[]|null); + + /** FetchReportResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a FetchReportResultsResponse. */ + class FetchReportResultsResponse implements IFetchReportResultsResponse { + + /** + * Constructs a new FetchReportResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IFetchReportResultsResponse); + + /** FetchReportResultsResponse reportMetadata. */ + public reportMetadata?: (google.cloud.channel.v1.IReportResultsMetadata|null); + + /** FetchReportResultsResponse rows. */ + public rows: google.cloud.channel.v1.IRow[]; + + /** FetchReportResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new FetchReportResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchReportResultsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IFetchReportResultsResponse): google.cloud.channel.v1.FetchReportResultsResponse; + + /** + * Encodes the specified FetchReportResultsResponse message. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsResponse.verify|verify} messages. + * @param message FetchReportResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IFetchReportResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchReportResultsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsResponse.verify|verify} messages. + * @param message FetchReportResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IFetchReportResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchReportResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchReportResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.FetchReportResultsResponse; + + /** + * Decodes a FetchReportResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchReportResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.FetchReportResultsResponse; + + /** + * Verifies a FetchReportResultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchReportResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchReportResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.FetchReportResultsResponse; + + /** + * Creates a plain object from a FetchReportResultsResponse message. Also converts values to other types if specified. + * @param message FetchReportResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.FetchReportResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchReportResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchReportResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReportsRequest. */ + interface IListReportsRequest { + + /** ListReportsRequest parent */ + parent?: (string|null); + + /** ListReportsRequest pageSize */ + pageSize?: (number|null); + + /** ListReportsRequest pageToken */ + pageToken?: (string|null); + + /** ListReportsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListReportsRequest. */ + class ListReportsRequest implements IListReportsRequest { + + /** + * Constructs a new ListReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListReportsRequest); + + /** ListReportsRequest parent. */ + public parent: string; + + /** ListReportsRequest pageSize. */ + public pageSize: number; + + /** ListReportsRequest pageToken. */ + public pageToken: string; + + /** ListReportsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReportsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListReportsRequest): google.cloud.channel.v1.ListReportsRequest; + + /** + * Encodes the specified ListReportsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListReportsRequest.verify|verify} messages. + * @param message ListReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReportsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListReportsRequest.verify|verify} messages. + * @param message ListReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListReportsRequest; + + /** + * Decodes a ListReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListReportsRequest; + + /** + * Verifies a ListReportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListReportsRequest; + + /** + * Creates a plain object from a ListReportsRequest message. Also converts values to other types if specified. + * @param message ListReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReportsResponse. */ + interface IListReportsResponse { + + /** ListReportsResponse reports */ + reports?: (google.cloud.channel.v1.IReport[]|null); + + /** ListReportsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReportsResponse. */ + class ListReportsResponse implements IListReportsResponse { + + /** + * Constructs a new ListReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListReportsResponse); + + /** ListReportsResponse reports. */ + public reports: google.cloud.channel.v1.IReport[]; + + /** ListReportsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReportsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListReportsResponse): google.cloud.channel.v1.ListReportsResponse; + + /** + * Encodes the specified ListReportsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListReportsResponse.verify|verify} messages. + * @param message ListReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReportsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListReportsResponse.verify|verify} messages. + * @param message ListReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListReportsResponse; + + /** + * Decodes a ListReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListReportsResponse; + + /** + * Verifies a ListReportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListReportsResponse; + + /** + * Creates a plain object from a ListReportsResponse message. Also converts values to other types if specified. + * @param message ListReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReportJob. */ + interface IReportJob { + + /** ReportJob name */ + name?: (string|null); + + /** ReportJob reportStatus */ + reportStatus?: (google.cloud.channel.v1.IReportStatus|null); + } + + /** Represents a ReportJob. */ + class ReportJob implements IReportJob { + + /** + * Constructs a new ReportJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IReportJob); + + /** ReportJob name. */ + public name: string; + + /** ReportJob reportStatus. */ + public reportStatus?: (google.cloud.channel.v1.IReportStatus|null); + + /** + * Creates a new ReportJob instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportJob instance + */ + public static create(properties?: google.cloud.channel.v1.IReportJob): google.cloud.channel.v1.ReportJob; + + /** + * Encodes the specified ReportJob message. Does not implicitly {@link google.cloud.channel.v1.ReportJob.verify|verify} messages. + * @param message ReportJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IReportJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportJob message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportJob.verify|verify} messages. + * @param message ReportJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IReportJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ReportJob; + + /** + * Decodes a ReportJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ReportJob; + + /** + * Verifies a ReportJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ReportJob; + + /** + * Creates a plain object from a ReportJob message. Also converts values to other types if specified. + * @param message ReportJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ReportJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReportResultsMetadata. */ + interface IReportResultsMetadata { + + /** ReportResultsMetadata report */ + report?: (google.cloud.channel.v1.IReport|null); + + /** ReportResultsMetadata rowCount */ + rowCount?: (number|Long|string|null); + + /** ReportResultsMetadata dateRange */ + dateRange?: (google.cloud.channel.v1.IDateRange|null); + + /** ReportResultsMetadata precedingDateRange */ + precedingDateRange?: (google.cloud.channel.v1.IDateRange|null); + } + + /** Represents a ReportResultsMetadata. */ + class ReportResultsMetadata implements IReportResultsMetadata { + + /** + * Constructs a new ReportResultsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IReportResultsMetadata); + + /** ReportResultsMetadata report. */ + public report?: (google.cloud.channel.v1.IReport|null); + + /** ReportResultsMetadata rowCount. */ + public rowCount: (number|Long|string); + + /** ReportResultsMetadata dateRange. */ + public dateRange?: (google.cloud.channel.v1.IDateRange|null); + + /** ReportResultsMetadata precedingDateRange. */ + public precedingDateRange?: (google.cloud.channel.v1.IDateRange|null); + + /** + * Creates a new ReportResultsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportResultsMetadata instance + */ + public static create(properties?: google.cloud.channel.v1.IReportResultsMetadata): google.cloud.channel.v1.ReportResultsMetadata; + + /** + * Encodes the specified ReportResultsMetadata message. Does not implicitly {@link google.cloud.channel.v1.ReportResultsMetadata.verify|verify} messages. + * @param message ReportResultsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IReportResultsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportResultsMetadata message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportResultsMetadata.verify|verify} messages. + * @param message ReportResultsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IReportResultsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportResultsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportResultsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ReportResultsMetadata; + + /** + * Decodes a ReportResultsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportResultsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ReportResultsMetadata; + + /** + * Verifies a ReportResultsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportResultsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportResultsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ReportResultsMetadata; + + /** + * Creates a plain object from a ReportResultsMetadata message. Also converts values to other types if specified. + * @param message ReportResultsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ReportResultsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportResultsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportResultsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Column. */ + interface IColumn { + + /** Column columnId */ + columnId?: (string|null); + + /** Column displayName */ + displayName?: (string|null); + + /** Column dataType */ + dataType?: (google.cloud.channel.v1.Column.DataType|keyof typeof google.cloud.channel.v1.Column.DataType|null); + } + + /** Represents a Column. */ + class Column implements IColumn { + + /** + * Constructs a new Column. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IColumn); + + /** Column columnId. */ + public columnId: string; + + /** Column displayName. */ + public displayName: string; + + /** Column dataType. */ + public dataType: (google.cloud.channel.v1.Column.DataType|keyof typeof google.cloud.channel.v1.Column.DataType); + + /** + * Creates a new Column instance using the specified properties. + * @param [properties] Properties to set + * @returns Column instance + */ + public static create(properties?: google.cloud.channel.v1.IColumn): google.cloud.channel.v1.Column; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.cloud.channel.v1.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Column.verify|verify} messages. + * @param message Column message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Column message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Column; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Column; + + /** + * Verifies a Column message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Column + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Column; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @param message Column + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Column, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Column to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Column + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Column { + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + STRING = 1, + INT = 2, + DECIMAL = 3, + MONEY = 4, + DATE = 5, + DATE_TIME = 6 + } + } + + /** Properties of a DateRange. */ + interface IDateRange { + + /** DateRange usageStartDateTime */ + usageStartDateTime?: (google.type.IDateTime|null); + + /** DateRange usageEndDateTime */ + usageEndDateTime?: (google.type.IDateTime|null); + + /** DateRange invoiceStartDate */ + invoiceStartDate?: (google.type.IDate|null); + + /** DateRange invoiceEndDate */ + invoiceEndDate?: (google.type.IDate|null); + } + + /** Represents a DateRange. */ + class DateRange implements IDateRange { + + /** + * Constructs a new DateRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IDateRange); + + /** DateRange usageStartDateTime. */ + public usageStartDateTime?: (google.type.IDateTime|null); + + /** DateRange usageEndDateTime. */ + public usageEndDateTime?: (google.type.IDateTime|null); + + /** DateRange invoiceStartDate. */ + public invoiceStartDate?: (google.type.IDate|null); + + /** DateRange invoiceEndDate. */ + public invoiceEndDate?: (google.type.IDate|null); + + /** + * Creates a new DateRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DateRange instance + */ + public static create(properties?: google.cloud.channel.v1.IDateRange): google.cloud.channel.v1.DateRange; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link google.cloud.channel.v1.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DateRange.verify|verify} messages. + * @param message DateRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IDateRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.DateRange; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.DateRange; + + /** + * Verifies a DateRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.DateRange; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @param message DateRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.DateRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row values */ + values?: (google.cloud.channel.v1.IReportValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRow); + + /** Row values. */ + public values: google.cloud.channel.v1.IReportValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.channel.v1.IRow): google.cloud.channel.v1.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.channel.v1.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReportValue. */ + interface IReportValue { + + /** ReportValue stringValue */ + stringValue?: (string|null); + + /** ReportValue intValue */ + intValue?: (number|Long|string|null); + + /** ReportValue decimalValue */ + decimalValue?: (google.type.IDecimal|null); + + /** ReportValue moneyValue */ + moneyValue?: (google.type.IMoney|null); + + /** ReportValue dateValue */ + dateValue?: (google.type.IDate|null); + + /** ReportValue dateTimeValue */ + dateTimeValue?: (google.type.IDateTime|null); + } + + /** Represents a ReportValue. */ + class ReportValue implements IReportValue { + + /** + * Constructs a new ReportValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IReportValue); + + /** ReportValue stringValue. */ + public stringValue?: (string|null); + + /** ReportValue intValue. */ + public intValue?: (number|Long|string|null); + + /** ReportValue decimalValue. */ + public decimalValue?: (google.type.IDecimal|null); + + /** ReportValue moneyValue. */ + public moneyValue?: (google.type.IMoney|null); + + /** ReportValue dateValue. */ + public dateValue?: (google.type.IDate|null); + + /** ReportValue dateTimeValue. */ + public dateTimeValue?: (google.type.IDateTime|null); + + /** ReportValue value. */ + public value?: ("stringValue"|"intValue"|"decimalValue"|"moneyValue"|"dateValue"|"dateTimeValue"); + + /** + * Creates a new ReportValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportValue instance + */ + public static create(properties?: google.cloud.channel.v1.IReportValue): google.cloud.channel.v1.ReportValue; + + /** + * Encodes the specified ReportValue message. Does not implicitly {@link google.cloud.channel.v1.ReportValue.verify|verify} messages. + * @param message ReportValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IReportValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportValue message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportValue.verify|verify} messages. + * @param message ReportValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IReportValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ReportValue; + + /** + * Decodes a ReportValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ReportValue; + + /** + * Verifies a ReportValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ReportValue; + + /** + * Creates a plain object from a ReportValue message. Also converts values to other types if specified. + * @param message ReportValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ReportValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReportStatus. */ + interface IReportStatus { + + /** ReportStatus state */ + state?: (google.cloud.channel.v1.ReportStatus.State|keyof typeof google.cloud.channel.v1.ReportStatus.State|null); + + /** ReportStatus startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ReportStatus endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ReportStatus. */ + class ReportStatus implements IReportStatus { + + /** + * Constructs a new ReportStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IReportStatus); + + /** ReportStatus state. */ + public state: (google.cloud.channel.v1.ReportStatus.State|keyof typeof google.cloud.channel.v1.ReportStatus.State); + + /** ReportStatus startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ReportStatus endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ReportStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportStatus instance + */ + public static create(properties?: google.cloud.channel.v1.IReportStatus): google.cloud.channel.v1.ReportStatus; + + /** + * Encodes the specified ReportStatus message. Does not implicitly {@link google.cloud.channel.v1.ReportStatus.verify|verify} messages. + * @param message ReportStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IReportStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportStatus message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportStatus.verify|verify} messages. + * @param message ReportStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IReportStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ReportStatus; + + /** + * Decodes a ReportStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ReportStatus; + + /** + * Verifies a ReportStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReportStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ReportStatus; + + /** + * Creates a plain object from a ReportStatus message. Also converts values to other types if specified. + * @param message ReportStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ReportStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReportStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STARTED = 1, + WRITING = 2, + AVAILABLE = 3, + FAILED = 4 + } + } + + /** Properties of a Report. */ + interface IReport { + + /** Report name */ + name?: (string|null); + + /** Report displayName */ + displayName?: (string|null); + + /** Report columns */ + columns?: (google.cloud.channel.v1.IColumn[]|null); + + /** Report description */ + description?: (string|null); + } + + /** Represents a Report. */ + class Report implements IReport { + + /** + * Constructs a new Report. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IReport); + + /** Report name. */ + public name: string; + + /** Report displayName. */ + public displayName: string; + + /** Report columns. */ + public columns: google.cloud.channel.v1.IColumn[]; + + /** Report description. */ + public description: string; + + /** + * Creates a new Report instance using the specified properties. + * @param [properties] Properties to set + * @returns Report instance + */ + public static create(properties?: google.cloud.channel.v1.IReport): google.cloud.channel.v1.Report; + + /** + * Encodes the specified Report message. Does not implicitly {@link google.cloud.channel.v1.Report.verify|verify} messages. + * @param message Report message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Report message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Report.verify|verify} messages. + * @param message Report message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Report message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.Report; + + /** + * Decodes a Report message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.Report; + + /** + * Verifies a Report message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Report message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Report + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.Report; + + /** + * Creates a plain object from a Report message. Also converts values to other types if specified. + * @param message Report + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.Report, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Report to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Report + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RebillingBasis enum. */ + enum RebillingBasis { + REBILLING_BASIS_UNSPECIFIED = 0, + COST_AT_LIST = 1, + DIRECT_CUSTOMER_COST = 2 + } + + /** Properties of a CustomerRepricingConfig. */ + interface ICustomerRepricingConfig { + + /** CustomerRepricingConfig name */ + name?: (string|null); + + /** CustomerRepricingConfig repricingConfig */ + repricingConfig?: (google.cloud.channel.v1.IRepricingConfig|null); + + /** CustomerRepricingConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CustomerRepricingConfig. */ + class CustomerRepricingConfig implements ICustomerRepricingConfig { + + /** + * Constructs a new CustomerRepricingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICustomerRepricingConfig); + + /** CustomerRepricingConfig name. */ + public name: string; + + /** CustomerRepricingConfig repricingConfig. */ + public repricingConfig?: (google.cloud.channel.v1.IRepricingConfig|null); + + /** CustomerRepricingConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CustomerRepricingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerRepricingConfig instance + */ + public static create(properties?: google.cloud.channel.v1.ICustomerRepricingConfig): google.cloud.channel.v1.CustomerRepricingConfig; + + /** + * Encodes the specified CustomerRepricingConfig message. Does not implicitly {@link google.cloud.channel.v1.CustomerRepricingConfig.verify|verify} messages. + * @param message CustomerRepricingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICustomerRepricingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerRepricingConfig message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CustomerRepricingConfig.verify|verify} messages. + * @param message CustomerRepricingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICustomerRepricingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerRepricingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CustomerRepricingConfig; + + /** + * Decodes a CustomerRepricingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CustomerRepricingConfig; + + /** + * Verifies a CustomerRepricingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerRepricingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerRepricingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CustomerRepricingConfig; + + /** + * Creates a plain object from a CustomerRepricingConfig message. Also converts values to other types if specified. + * @param message CustomerRepricingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CustomerRepricingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerRepricingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerRepricingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelPartnerRepricingConfig. */ + interface IChannelPartnerRepricingConfig { + + /** ChannelPartnerRepricingConfig name */ + name?: (string|null); + + /** ChannelPartnerRepricingConfig repricingConfig */ + repricingConfig?: (google.cloud.channel.v1.IRepricingConfig|null); + + /** ChannelPartnerRepricingConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ChannelPartnerRepricingConfig. */ + class ChannelPartnerRepricingConfig implements IChannelPartnerRepricingConfig { + + /** + * Constructs a new ChannelPartnerRepricingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IChannelPartnerRepricingConfig); + + /** ChannelPartnerRepricingConfig name. */ + public name: string; + + /** ChannelPartnerRepricingConfig repricingConfig. */ + public repricingConfig?: (google.cloud.channel.v1.IRepricingConfig|null); + + /** ChannelPartnerRepricingConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ChannelPartnerRepricingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelPartnerRepricingConfig instance + */ + public static create(properties?: google.cloud.channel.v1.IChannelPartnerRepricingConfig): google.cloud.channel.v1.ChannelPartnerRepricingConfig; + + /** + * Encodes the specified ChannelPartnerRepricingConfig message. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify|verify} messages. + * @param message ChannelPartnerRepricingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IChannelPartnerRepricingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelPartnerRepricingConfig message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify|verify} messages. + * @param message ChannelPartnerRepricingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IChannelPartnerRepricingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelPartnerRepricingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelPartnerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ChannelPartnerRepricingConfig; + + /** + * Decodes a ChannelPartnerRepricingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelPartnerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ChannelPartnerRepricingConfig; + + /** + * Verifies a ChannelPartnerRepricingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelPartnerRepricingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelPartnerRepricingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ChannelPartnerRepricingConfig; + + /** + * Creates a plain object from a ChannelPartnerRepricingConfig message. Also converts values to other types if specified. + * @param message ChannelPartnerRepricingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ChannelPartnerRepricingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelPartnerRepricingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelPartnerRepricingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RepricingConfig. */ + interface IRepricingConfig { + + /** RepricingConfig entitlementGranularity */ + entitlementGranularity?: (google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity|null); + + /** RepricingConfig channelPartnerGranularity */ + channelPartnerGranularity?: (google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity|null); + + /** RepricingConfig effectiveInvoiceMonth */ + effectiveInvoiceMonth?: (google.type.IDate|null); + + /** RepricingConfig adjustment */ + adjustment?: (google.cloud.channel.v1.IRepricingAdjustment|null); + + /** RepricingConfig rebillingBasis */ + rebillingBasis?: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis|null); + } + + /** Represents a RepricingConfig. */ + class RepricingConfig implements IRepricingConfig { + + /** + * Constructs a new RepricingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRepricingConfig); + + /** RepricingConfig entitlementGranularity. */ + public entitlementGranularity?: (google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity|null); + + /** RepricingConfig channelPartnerGranularity. */ + public channelPartnerGranularity?: (google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity|null); + + /** RepricingConfig effectiveInvoiceMonth. */ + public effectiveInvoiceMonth?: (google.type.IDate|null); + + /** RepricingConfig adjustment. */ + public adjustment?: (google.cloud.channel.v1.IRepricingAdjustment|null); + + /** RepricingConfig rebillingBasis. */ + public rebillingBasis: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis); + + /** RepricingConfig granularity. */ + public granularity?: ("entitlementGranularity"|"channelPartnerGranularity"); + + /** + * Creates a new RepricingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RepricingConfig instance + */ + public static create(properties?: google.cloud.channel.v1.IRepricingConfig): google.cloud.channel.v1.RepricingConfig; + + /** + * Encodes the specified RepricingConfig message. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.verify|verify} messages. + * @param message RepricingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRepricingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepricingConfig message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.verify|verify} messages. + * @param message RepricingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRepricingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepricingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RepricingConfig; + + /** + * Decodes a RepricingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RepricingConfig; + + /** + * Verifies a RepricingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepricingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepricingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RepricingConfig; + + /** + * Creates a plain object from a RepricingConfig message. Also converts values to other types if specified. + * @param message RepricingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RepricingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepricingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepricingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RepricingConfig { + + /** Properties of an EntitlementGranularity. */ + interface IEntitlementGranularity { + + /** EntitlementGranularity entitlement */ + entitlement?: (string|null); + } + + /** Represents an EntitlementGranularity. */ + class EntitlementGranularity implements IEntitlementGranularity { + + /** + * Constructs a new EntitlementGranularity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity); + + /** EntitlementGranularity entitlement. */ + public entitlement: string; + + /** + * Creates a new EntitlementGranularity instance using the specified properties. + * @param [properties] Properties to set + * @returns EntitlementGranularity instance + */ + public static create(properties?: google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity): google.cloud.channel.v1.RepricingConfig.EntitlementGranularity; + + /** + * Encodes the specified EntitlementGranularity message. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.verify|verify} messages. + * @param message EntitlementGranularity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntitlementGranularity message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.verify|verify} messages. + * @param message EntitlementGranularity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntitlementGranularity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntitlementGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RepricingConfig.EntitlementGranularity; + + /** + * Decodes an EntitlementGranularity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntitlementGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RepricingConfig.EntitlementGranularity; + + /** + * Verifies an EntitlementGranularity message. + * @param message Plain 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 EntitlementGranularity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntitlementGranularity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RepricingConfig.EntitlementGranularity; + + /** + * Creates a plain object from an EntitlementGranularity message. Also converts values to other types if specified. + * @param message EntitlementGranularity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RepricingConfig.EntitlementGranularity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntitlementGranularity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntitlementGranularity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelPartnerGranularity. */ + interface IChannelPartnerGranularity { + } + + /** Represents a ChannelPartnerGranularity. */ + class ChannelPartnerGranularity implements IChannelPartnerGranularity { + + /** + * Constructs a new ChannelPartnerGranularity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity); + + /** + * Creates a new ChannelPartnerGranularity instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelPartnerGranularity instance + */ + public static create(properties?: google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity): google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity; + + /** + * Encodes the specified ChannelPartnerGranularity message. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.verify|verify} messages. + * @param message ChannelPartnerGranularity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChannelPartnerGranularity message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.verify|verify} messages. + * @param message ChannelPartnerGranularity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChannelPartnerGranularity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelPartnerGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity; + + /** + * Decodes a ChannelPartnerGranularity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelPartnerGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity; + + /** + * Verifies a ChannelPartnerGranularity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChannelPartnerGranularity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelPartnerGranularity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity; + + /** + * Creates a plain object from a ChannelPartnerGranularity message. Also converts values to other types if specified. + * @param message ChannelPartnerGranularity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChannelPartnerGranularity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelPartnerGranularity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RepricingAdjustment. */ + interface IRepricingAdjustment { + + /** RepricingAdjustment percentageAdjustment */ + percentageAdjustment?: (google.cloud.channel.v1.IPercentageAdjustment|null); + } + + /** Represents a RepricingAdjustment. */ + class RepricingAdjustment implements IRepricingAdjustment { + + /** + * Constructs a new RepricingAdjustment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRepricingAdjustment); + + /** RepricingAdjustment percentageAdjustment. */ + public percentageAdjustment?: (google.cloud.channel.v1.IPercentageAdjustment|null); + + /** RepricingAdjustment adjustment. */ + public adjustment?: "percentageAdjustment"; + + /** + * Creates a new RepricingAdjustment instance using the specified properties. + * @param [properties] Properties to set + * @returns RepricingAdjustment instance + */ + public static create(properties?: google.cloud.channel.v1.IRepricingAdjustment): google.cloud.channel.v1.RepricingAdjustment; + + /** + * Encodes the specified RepricingAdjustment message. Does not implicitly {@link google.cloud.channel.v1.RepricingAdjustment.verify|verify} messages. + * @param message RepricingAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRepricingAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepricingAdjustment message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingAdjustment.verify|verify} messages. + * @param message RepricingAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRepricingAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepricingAdjustment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepricingAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RepricingAdjustment; + + /** + * Decodes a RepricingAdjustment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepricingAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RepricingAdjustment; + + /** + * Verifies a RepricingAdjustment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepricingAdjustment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepricingAdjustment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RepricingAdjustment; + + /** + * Creates a plain object from a RepricingAdjustment message. Also converts values to other types if specified. + * @param message RepricingAdjustment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RepricingAdjustment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepricingAdjustment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepricingAdjustment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PercentageAdjustment. */ + interface IPercentageAdjustment { + + /** PercentageAdjustment percentage */ + percentage?: (google.type.IDecimal|null); + } + + /** Represents a PercentageAdjustment. */ + class PercentageAdjustment implements IPercentageAdjustment { + + /** + * Constructs a new PercentageAdjustment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPercentageAdjustment); + + /** PercentageAdjustment percentage. */ + public percentage?: (google.type.IDecimal|null); + + /** + * Creates a new PercentageAdjustment instance using the specified properties. + * @param [properties] Properties to set + * @returns PercentageAdjustment instance + */ + public static create(properties?: google.cloud.channel.v1.IPercentageAdjustment): google.cloud.channel.v1.PercentageAdjustment; + + /** + * Encodes the specified PercentageAdjustment message. Does not implicitly {@link google.cloud.channel.v1.PercentageAdjustment.verify|verify} messages. + * @param message PercentageAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPercentageAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PercentageAdjustment message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PercentageAdjustment.verify|verify} messages. + * @param message PercentageAdjustment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPercentageAdjustment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PercentageAdjustment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PercentageAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.PercentageAdjustment; + + /** + * Decodes a PercentageAdjustment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PercentageAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.PercentageAdjustment; + + /** + * Verifies a PercentageAdjustment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PercentageAdjustment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PercentageAdjustment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.PercentageAdjustment; + + /** + * Creates a plain object from a PercentageAdjustment message. Also converts values to other types if specified. + * @param message PercentageAdjustment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.PercentageAdjustment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PercentageAdjustment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PercentageAdjustment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a CloudChannelService */ + class CloudChannelService extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudChannelService 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 CloudChannelService 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): CloudChannelService; + + /** + * Calls ListCustomers. + * @param request ListCustomersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCustomersResponse + */ + public listCustomers(request: google.cloud.channel.v1.IListCustomersRequest, callback: google.cloud.channel.v1.CloudChannelService.ListCustomersCallback): void; + + /** + * Calls ListCustomers. + * @param request ListCustomersRequest message or plain object + * @returns Promise + */ + public listCustomers(request: google.cloud.channel.v1.IListCustomersRequest): Promise; + + /** + * Calls GetCustomer. + * @param request GetCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Customer + */ + public getCustomer(request: google.cloud.channel.v1.IGetCustomerRequest, callback: google.cloud.channel.v1.CloudChannelService.GetCustomerCallback): void; + + /** + * Calls GetCustomer. + * @param request GetCustomerRequest message or plain object + * @returns Promise + */ + public getCustomer(request: google.cloud.channel.v1.IGetCustomerRequest): Promise; + + /** + * Calls CheckCloudIdentityAccountsExist. + * @param request CheckCloudIdentityAccountsExistRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckCloudIdentityAccountsExistResponse + */ + public checkCloudIdentityAccountsExist(request: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, callback: google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExistCallback): void; + + /** + * Calls CheckCloudIdentityAccountsExist. + * @param request CheckCloudIdentityAccountsExistRequest message or plain object + * @returns Promise + */ + public checkCloudIdentityAccountsExist(request: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest): Promise; + + /** + * Calls CreateCustomer. + * @param request CreateCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Customer + */ + public createCustomer(request: google.cloud.channel.v1.ICreateCustomerRequest, callback: google.cloud.channel.v1.CloudChannelService.CreateCustomerCallback): void; + + /** + * Calls CreateCustomer. + * @param request CreateCustomerRequest message or plain object + * @returns Promise + */ + public createCustomer(request: google.cloud.channel.v1.ICreateCustomerRequest): Promise; + + /** + * Calls UpdateCustomer. + * @param request UpdateCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Customer + */ + public updateCustomer(request: google.cloud.channel.v1.IUpdateCustomerRequest, callback: google.cloud.channel.v1.CloudChannelService.UpdateCustomerCallback): void; + + /** + * Calls UpdateCustomer. + * @param request UpdateCustomerRequest message or plain object + * @returns Promise + */ + public updateCustomer(request: google.cloud.channel.v1.IUpdateCustomerRequest): Promise; + + /** + * Calls DeleteCustomer. + * @param request DeleteCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCustomer(request: google.cloud.channel.v1.IDeleteCustomerRequest, callback: google.cloud.channel.v1.CloudChannelService.DeleteCustomerCallback): void; + + /** + * Calls DeleteCustomer. + * @param request DeleteCustomerRequest message or plain object + * @returns Promise + */ + public deleteCustomer(request: google.cloud.channel.v1.IDeleteCustomerRequest): Promise; + + /** + * Calls ImportCustomer. + * @param request ImportCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Customer + */ + public importCustomer(request: google.cloud.channel.v1.IImportCustomerRequest, callback: google.cloud.channel.v1.CloudChannelService.ImportCustomerCallback): void; + + /** + * Calls ImportCustomer. + * @param request ImportCustomerRequest message or plain object + * @returns Promise + */ + public importCustomer(request: google.cloud.channel.v1.IImportCustomerRequest): Promise; + + /** + * Calls ProvisionCloudIdentity. + * @param request ProvisionCloudIdentityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public provisionCloudIdentity(request: google.cloud.channel.v1.IProvisionCloudIdentityRequest, callback: google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentityCallback): void; + + /** + * Calls ProvisionCloudIdentity. + * @param request ProvisionCloudIdentityRequest message or plain object + * @returns Promise + */ + public provisionCloudIdentity(request: google.cloud.channel.v1.IProvisionCloudIdentityRequest): Promise; + + /** + * Calls ListEntitlements. + * @param request ListEntitlementsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEntitlementsResponse + */ + public listEntitlements(request: google.cloud.channel.v1.IListEntitlementsRequest, callback: google.cloud.channel.v1.CloudChannelService.ListEntitlementsCallback): void; + + /** + * Calls ListEntitlements. + * @param request ListEntitlementsRequest message or plain object + * @returns Promise + */ + public listEntitlements(request: google.cloud.channel.v1.IListEntitlementsRequest): Promise; + + /** + * Calls ListTransferableSkus. + * @param request ListTransferableSkusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferableSkusResponse + */ + public listTransferableSkus(request: google.cloud.channel.v1.IListTransferableSkusRequest, callback: google.cloud.channel.v1.CloudChannelService.ListTransferableSkusCallback): void; + + /** + * Calls ListTransferableSkus. + * @param request ListTransferableSkusRequest message or plain object + * @returns Promise + */ + public listTransferableSkus(request: google.cloud.channel.v1.IListTransferableSkusRequest): Promise; + + /** + * Calls ListTransferableOffers. + * @param request ListTransferableOffersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTransferableOffersResponse + */ + public listTransferableOffers(request: google.cloud.channel.v1.IListTransferableOffersRequest, callback: google.cloud.channel.v1.CloudChannelService.ListTransferableOffersCallback): void; + + /** + * Calls ListTransferableOffers. + * @param request ListTransferableOffersRequest message or plain object + * @returns Promise + */ + public listTransferableOffers(request: google.cloud.channel.v1.IListTransferableOffersRequest): Promise; + + /** + * Calls GetEntitlement. + * @param request GetEntitlementRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Entitlement + */ + public getEntitlement(request: google.cloud.channel.v1.IGetEntitlementRequest, callback: google.cloud.channel.v1.CloudChannelService.GetEntitlementCallback): void; + + /** + * Calls GetEntitlement. + * @param request GetEntitlementRequest message or plain object + * @returns Promise + */ + public getEntitlement(request: google.cloud.channel.v1.IGetEntitlementRequest): Promise; + + /** + * Calls CreateEntitlement. + * @param request CreateEntitlementRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEntitlement(request: google.cloud.channel.v1.ICreateEntitlementRequest, callback: google.cloud.channel.v1.CloudChannelService.CreateEntitlementCallback): void; + + /** + * Calls CreateEntitlement. + * @param request CreateEntitlementRequest message or plain object + * @returns Promise + */ + public createEntitlement(request: google.cloud.channel.v1.ICreateEntitlementRequest): Promise; + + /** + * Calls ChangeParameters. + * @param request ChangeParametersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public changeParameters(request: google.cloud.channel.v1.IChangeParametersRequest, callback: google.cloud.channel.v1.CloudChannelService.ChangeParametersCallback): void; + + /** + * Calls ChangeParameters. + * @param request ChangeParametersRequest message or plain object + * @returns Promise + */ + public changeParameters(request: google.cloud.channel.v1.IChangeParametersRequest): Promise; + + /** + * Calls ChangeRenewalSettings. + * @param request ChangeRenewalSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public changeRenewalSettings(request: google.cloud.channel.v1.IChangeRenewalSettingsRequest, callback: google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettingsCallback): void; + + /** + * Calls ChangeRenewalSettings. + * @param request ChangeRenewalSettingsRequest message or plain object + * @returns Promise + */ + public changeRenewalSettings(request: google.cloud.channel.v1.IChangeRenewalSettingsRequest): Promise; + + /** + * Calls ChangeOffer. + * @param request ChangeOfferRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public changeOffer(request: google.cloud.channel.v1.IChangeOfferRequest, callback: google.cloud.channel.v1.CloudChannelService.ChangeOfferCallback): void; + + /** + * Calls ChangeOffer. + * @param request ChangeOfferRequest message or plain object + * @returns Promise + */ + public changeOffer(request: google.cloud.channel.v1.IChangeOfferRequest): Promise; + + /** + * Calls StartPaidService. + * @param request StartPaidServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startPaidService(request: google.cloud.channel.v1.IStartPaidServiceRequest, callback: google.cloud.channel.v1.CloudChannelService.StartPaidServiceCallback): void; + + /** + * Calls StartPaidService. + * @param request StartPaidServiceRequest message or plain object + * @returns Promise + */ + public startPaidService(request: google.cloud.channel.v1.IStartPaidServiceRequest): Promise; + + /** + * Calls SuspendEntitlement. + * @param request SuspendEntitlementRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public suspendEntitlement(request: google.cloud.channel.v1.ISuspendEntitlementRequest, callback: google.cloud.channel.v1.CloudChannelService.SuspendEntitlementCallback): void; + + /** + * Calls SuspendEntitlement. + * @param request SuspendEntitlementRequest message or plain object + * @returns Promise + */ + public suspendEntitlement(request: google.cloud.channel.v1.ISuspendEntitlementRequest): Promise; + + /** + * Calls CancelEntitlement. + * @param request CancelEntitlementRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelEntitlement(request: google.cloud.channel.v1.ICancelEntitlementRequest, callback: google.cloud.channel.v1.CloudChannelService.CancelEntitlementCallback): void; + + /** + * Calls CancelEntitlement. + * @param request CancelEntitlementRequest message or plain object + * @returns Promise + */ + public cancelEntitlement(request: google.cloud.channel.v1.ICancelEntitlementRequest): Promise; + + /** + * Calls ActivateEntitlement. + * @param request ActivateEntitlementRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public activateEntitlement(request: google.cloud.channel.v1.IActivateEntitlementRequest, callback: google.cloud.channel.v1.CloudChannelService.ActivateEntitlementCallback): void; + + /** + * Calls ActivateEntitlement. + * @param request ActivateEntitlementRequest message or plain object + * @returns Promise + */ + public activateEntitlement(request: google.cloud.channel.v1.IActivateEntitlementRequest): Promise; + + /** + * Calls TransferEntitlements. + * @param request TransferEntitlementsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public transferEntitlements(request: google.cloud.channel.v1.ITransferEntitlementsRequest, callback: google.cloud.channel.v1.CloudChannelService.TransferEntitlementsCallback): void; + + /** + * Calls TransferEntitlements. + * @param request TransferEntitlementsRequest message or plain object + * @returns Promise + */ + public transferEntitlements(request: google.cloud.channel.v1.ITransferEntitlementsRequest): Promise; + + /** + * Calls TransferEntitlementsToGoogle. + * @param request TransferEntitlementsToGoogleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public transferEntitlementsToGoogle(request: google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, callback: google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogleCallback): void; + + /** + * Calls TransferEntitlementsToGoogle. + * @param request TransferEntitlementsToGoogleRequest message or plain object + * @returns Promise + */ + public transferEntitlementsToGoogle(request: google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest): Promise; + + /** + * Calls ListChannelPartnerLinks. + * @param request ListChannelPartnerLinksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChannelPartnerLinksResponse + */ + public listChannelPartnerLinks(request: google.cloud.channel.v1.IListChannelPartnerLinksRequest, callback: google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinksCallback): void; + + /** + * Calls ListChannelPartnerLinks. + * @param request ListChannelPartnerLinksRequest message or plain object + * @returns Promise + */ + public listChannelPartnerLinks(request: google.cloud.channel.v1.IListChannelPartnerLinksRequest): Promise; + + /** + * Calls GetChannelPartnerLink. + * @param request GetChannelPartnerLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ChannelPartnerLink + */ + public getChannelPartnerLink(request: google.cloud.channel.v1.IGetChannelPartnerLinkRequest, callback: google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLinkCallback): void; + + /** + * Calls GetChannelPartnerLink. + * @param request GetChannelPartnerLinkRequest message or plain object + * @returns Promise + */ + public getChannelPartnerLink(request: google.cloud.channel.v1.IGetChannelPartnerLinkRequest): Promise; + + /** + * Calls CreateChannelPartnerLink. + * @param request CreateChannelPartnerLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ChannelPartnerLink + */ + public createChannelPartnerLink(request: google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, callback: google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLinkCallback): void; + + /** + * Calls CreateChannelPartnerLink. + * @param request CreateChannelPartnerLinkRequest message or plain object + * @returns Promise + */ + public createChannelPartnerLink(request: google.cloud.channel.v1.ICreateChannelPartnerLinkRequest): Promise; + + /** + * Calls UpdateChannelPartnerLink. + * @param request UpdateChannelPartnerLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ChannelPartnerLink + */ + public updateChannelPartnerLink(request: google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, callback: google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLinkCallback): void; + + /** + * Calls UpdateChannelPartnerLink. + * @param request UpdateChannelPartnerLinkRequest message or plain object + * @returns Promise + */ + public updateChannelPartnerLink(request: google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest): Promise; + + /** + * Calls GetCustomerRepricingConfig. + * @param request GetCustomerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomerRepricingConfig + */ + public getCustomerRepricingConfig(request: google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfigCallback): void; + + /** + * Calls GetCustomerRepricingConfig. + * @param request GetCustomerRepricingConfigRequest message or plain object + * @returns Promise + */ + public getCustomerRepricingConfig(request: google.cloud.channel.v1.IGetCustomerRepricingConfigRequest): Promise; + + /** + * Calls ListCustomerRepricingConfigs. + * @param request ListCustomerRepricingConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCustomerRepricingConfigsResponse + */ + public listCustomerRepricingConfigs(request: google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, callback: google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigsCallback): void; + + /** + * Calls ListCustomerRepricingConfigs. + * @param request ListCustomerRepricingConfigsRequest message or plain object + * @returns Promise + */ + public listCustomerRepricingConfigs(request: google.cloud.channel.v1.IListCustomerRepricingConfigsRequest): Promise; + + /** + * Calls CreateCustomerRepricingConfig. + * @param request CreateCustomerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomerRepricingConfig + */ + public createCustomerRepricingConfig(request: google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfigCallback): void; + + /** + * Calls CreateCustomerRepricingConfig. + * @param request CreateCustomerRepricingConfigRequest message or plain object + * @returns Promise + */ + public createCustomerRepricingConfig(request: google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest): Promise; + + /** + * Calls UpdateCustomerRepricingConfig. + * @param request UpdateCustomerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CustomerRepricingConfig + */ + public updateCustomerRepricingConfig(request: google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfigCallback): void; + + /** + * Calls UpdateCustomerRepricingConfig. + * @param request UpdateCustomerRepricingConfigRequest message or plain object + * @returns Promise + */ + public updateCustomerRepricingConfig(request: google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest): Promise; + + /** + * Calls DeleteCustomerRepricingConfig. + * @param request DeleteCustomerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCustomerRepricingConfig(request: google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfigCallback): void; + + /** + * Calls DeleteCustomerRepricingConfig. + * @param request DeleteCustomerRepricingConfigRequest message or plain object + * @returns Promise + */ + public deleteCustomerRepricingConfig(request: google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest): Promise; + + /** + * Calls GetChannelPartnerRepricingConfig. + * @param request GetChannelPartnerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ChannelPartnerRepricingConfig + */ + public getChannelPartnerRepricingConfig(request: google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfigCallback): void; + + /** + * Calls GetChannelPartnerRepricingConfig. + * @param request GetChannelPartnerRepricingConfigRequest message or plain object + * @returns Promise + */ + public getChannelPartnerRepricingConfig(request: google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest): Promise; + + /** + * Calls ListChannelPartnerRepricingConfigs. + * @param request ListChannelPartnerRepricingConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChannelPartnerRepricingConfigsResponse + */ + public listChannelPartnerRepricingConfigs(request: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, callback: google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigsCallback): void; + + /** + * Calls ListChannelPartnerRepricingConfigs. + * @param request ListChannelPartnerRepricingConfigsRequest message or plain object + * @returns Promise + */ + public listChannelPartnerRepricingConfigs(request: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest): Promise; + + /** + * Calls CreateChannelPartnerRepricingConfig. + * @param request CreateChannelPartnerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ChannelPartnerRepricingConfig + */ + public createChannelPartnerRepricingConfig(request: google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfigCallback): void; + + /** + * Calls CreateChannelPartnerRepricingConfig. + * @param request CreateChannelPartnerRepricingConfigRequest message or plain object + * @returns Promise + */ + public createChannelPartnerRepricingConfig(request: google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest): Promise; + + /** + * Calls UpdateChannelPartnerRepricingConfig. + * @param request UpdateChannelPartnerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ChannelPartnerRepricingConfig + */ + public updateChannelPartnerRepricingConfig(request: google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerRepricingConfigCallback): void; + + /** + * Calls UpdateChannelPartnerRepricingConfig. + * @param request UpdateChannelPartnerRepricingConfigRequest message or plain object + * @returns Promise + */ + public updateChannelPartnerRepricingConfig(request: google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest): Promise; + + /** + * Calls DeleteChannelPartnerRepricingConfig. + * @param request DeleteChannelPartnerRepricingConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteChannelPartnerRepricingConfig(request: google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, callback: google.cloud.channel.v1.CloudChannelService.DeleteChannelPartnerRepricingConfigCallback): void; + + /** + * Calls DeleteChannelPartnerRepricingConfig. + * @param request DeleteChannelPartnerRepricingConfigRequest message or plain object + * @returns Promise + */ + public deleteChannelPartnerRepricingConfig(request: google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest): Promise; + + /** + * Calls LookupOffer. + * @param request LookupOfferRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Offer + */ + public lookupOffer(request: google.cloud.channel.v1.ILookupOfferRequest, callback: google.cloud.channel.v1.CloudChannelService.LookupOfferCallback): void; + + /** + * Calls LookupOffer. + * @param request LookupOfferRequest message or plain object + * @returns Promise + */ + public lookupOffer(request: google.cloud.channel.v1.ILookupOfferRequest): Promise; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProductsResponse + */ + public listProducts(request: google.cloud.channel.v1.IListProductsRequest, callback: google.cloud.channel.v1.CloudChannelService.ListProductsCallback): void; + + /** + * Calls ListProducts. + * @param request ListProductsRequest message or plain object + * @returns Promise + */ + public listProducts(request: google.cloud.channel.v1.IListProductsRequest): Promise; + + /** + * Calls ListSkus. + * @param request ListSkusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSkusResponse + */ + public listSkus(request: google.cloud.channel.v1.IListSkusRequest, callback: google.cloud.channel.v1.CloudChannelService.ListSkusCallback): void; + + /** + * Calls ListSkus. + * @param request ListSkusRequest message or plain object + * @returns Promise + */ + public listSkus(request: google.cloud.channel.v1.IListSkusRequest): Promise; + + /** + * Calls ListOffers. + * @param request ListOffersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOffersResponse + */ + public listOffers(request: google.cloud.channel.v1.IListOffersRequest, callback: google.cloud.channel.v1.CloudChannelService.ListOffersCallback): void; + + /** + * Calls ListOffers. + * @param request ListOffersRequest message or plain object + * @returns Promise + */ + public listOffers(request: google.cloud.channel.v1.IListOffersRequest): Promise; + + /** + * Calls ListPurchasableSkus. + * @param request ListPurchasableSkusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPurchasableSkusResponse + */ + public listPurchasableSkus(request: google.cloud.channel.v1.IListPurchasableSkusRequest, callback: google.cloud.channel.v1.CloudChannelService.ListPurchasableSkusCallback): void; + + /** + * Calls ListPurchasableSkus. + * @param request ListPurchasableSkusRequest message or plain object + * @returns Promise + */ + public listPurchasableSkus(request: google.cloud.channel.v1.IListPurchasableSkusRequest): Promise; + + /** + * Calls ListPurchasableOffers. + * @param request ListPurchasableOffersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPurchasableOffersResponse + */ + public listPurchasableOffers(request: google.cloud.channel.v1.IListPurchasableOffersRequest, callback: google.cloud.channel.v1.CloudChannelService.ListPurchasableOffersCallback): void; + + /** + * Calls ListPurchasableOffers. + * @param request ListPurchasableOffersRequest message or plain object + * @returns Promise + */ + public listPurchasableOffers(request: google.cloud.channel.v1.IListPurchasableOffersRequest): Promise; + + /** + * Calls RegisterSubscriber. + * @param request RegisterSubscriberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegisterSubscriberResponse + */ + public registerSubscriber(request: google.cloud.channel.v1.IRegisterSubscriberRequest, callback: google.cloud.channel.v1.CloudChannelService.RegisterSubscriberCallback): void; + + /** + * Calls RegisterSubscriber. + * @param request RegisterSubscriberRequest message or plain object + * @returns Promise + */ + public registerSubscriber(request: google.cloud.channel.v1.IRegisterSubscriberRequest): Promise; + + /** + * Calls UnregisterSubscriber. + * @param request UnregisterSubscriberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UnregisterSubscriberResponse + */ + public unregisterSubscriber(request: google.cloud.channel.v1.IUnregisterSubscriberRequest, callback: google.cloud.channel.v1.CloudChannelService.UnregisterSubscriberCallback): void; + + /** + * Calls UnregisterSubscriber. + * @param request UnregisterSubscriberRequest message or plain object + * @returns Promise + */ + public unregisterSubscriber(request: google.cloud.channel.v1.IUnregisterSubscriberRequest): Promise; + + /** + * Calls ListSubscribers. + * @param request ListSubscribersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubscribersResponse + */ + public listSubscribers(request: google.cloud.channel.v1.IListSubscribersRequest, callback: google.cloud.channel.v1.CloudChannelService.ListSubscribersCallback): void; + + /** + * Calls ListSubscribers. + * @param request ListSubscribersRequest message or plain object + * @returns Promise + */ + public listSubscribers(request: google.cloud.channel.v1.IListSubscribersRequest): Promise; + } + + namespace CloudChannelService { + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listCustomers}. + * @param error Error, if any + * @param [response] ListCustomersResponse + */ + type ListCustomersCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListCustomersResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getCustomer}. + * @param error Error, if any + * @param [response] Customer + */ + type GetCustomerCallback = (error: (Error|null), response?: google.cloud.channel.v1.Customer) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|checkCloudIdentityAccountsExist}. + * @param error Error, if any + * @param [response] CheckCloudIdentityAccountsExistResponse + */ + type CheckCloudIdentityAccountsExistCallback = (error: (Error|null), response?: google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createCustomer}. + * @param error Error, if any + * @param [response] Customer + */ + type CreateCustomerCallback = (error: (Error|null), response?: google.cloud.channel.v1.Customer) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateCustomer}. + * @param error Error, if any + * @param [response] Customer + */ + type UpdateCustomerCallback = (error: (Error|null), response?: google.cloud.channel.v1.Customer) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|deleteCustomer}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCustomerCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|importCustomer}. + * @param error Error, if any + * @param [response] Customer + */ + type ImportCustomerCallback = (error: (Error|null), response?: google.cloud.channel.v1.Customer) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|provisionCloudIdentity}. + * @param error Error, if any + * @param [response] Operation + */ + type ProvisionCloudIdentityCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listEntitlements}. + * @param error Error, if any + * @param [response] ListEntitlementsResponse + */ + type ListEntitlementsCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListEntitlementsResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listTransferableSkus}. + * @param error Error, if any + * @param [response] ListTransferableSkusResponse + */ + type ListTransferableSkusCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListTransferableSkusResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listTransferableOffers}. + * @param error Error, if any + * @param [response] ListTransferableOffersResponse + */ + type ListTransferableOffersCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListTransferableOffersResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getEntitlement}. + * @param error Error, if any + * @param [response] Entitlement + */ + type GetEntitlementCallback = (error: (Error|null), response?: google.cloud.channel.v1.Entitlement) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createEntitlement}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEntitlementCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|changeParameters}. + * @param error Error, if any + * @param [response] Operation + */ + type ChangeParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|changeRenewalSettings}. + * @param error Error, if any + * @param [response] Operation + */ + type ChangeRenewalSettingsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|changeOffer}. + * @param error Error, if any + * @param [response] Operation + */ + type ChangeOfferCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|startPaidService}. + * @param error Error, if any + * @param [response] Operation + */ + type StartPaidServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|suspendEntitlement}. + * @param error Error, if any + * @param [response] Operation + */ + type SuspendEntitlementCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|cancelEntitlement}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelEntitlementCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|activateEntitlement}. + * @param error Error, if any + * @param [response] Operation + */ + type ActivateEntitlementCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|transferEntitlements}. + * @param error Error, if any + * @param [response] Operation + */ + type TransferEntitlementsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|transferEntitlementsToGoogle}. + * @param error Error, if any + * @param [response] Operation + */ + type TransferEntitlementsToGoogleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listChannelPartnerLinks}. + * @param error Error, if any + * @param [response] ListChannelPartnerLinksResponse + */ + type ListChannelPartnerLinksCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListChannelPartnerLinksResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getChannelPartnerLink}. + * @param error Error, if any + * @param [response] ChannelPartnerLink + */ + type GetChannelPartnerLinkCallback = (error: (Error|null), response?: google.cloud.channel.v1.ChannelPartnerLink) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createChannelPartnerLink}. + * @param error Error, if any + * @param [response] ChannelPartnerLink + */ + type CreateChannelPartnerLinkCallback = (error: (Error|null), response?: google.cloud.channel.v1.ChannelPartnerLink) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateChannelPartnerLink}. + * @param error Error, if any + * @param [response] ChannelPartnerLink + */ + type UpdateChannelPartnerLinkCallback = (error: (Error|null), response?: google.cloud.channel.v1.ChannelPartnerLink) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getCustomerRepricingConfig}. + * @param error Error, if any + * @param [response] CustomerRepricingConfig + */ + type GetCustomerRepricingConfigCallback = (error: (Error|null), response?: google.cloud.channel.v1.CustomerRepricingConfig) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listCustomerRepricingConfigs}. + * @param error Error, if any + * @param [response] ListCustomerRepricingConfigsResponse + */ + type ListCustomerRepricingConfigsCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListCustomerRepricingConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createCustomerRepricingConfig}. + * @param error Error, if any + * @param [response] CustomerRepricingConfig + */ + type CreateCustomerRepricingConfigCallback = (error: (Error|null), response?: google.cloud.channel.v1.CustomerRepricingConfig) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateCustomerRepricingConfig}. + * @param error Error, if any + * @param [response] CustomerRepricingConfig + */ + type UpdateCustomerRepricingConfigCallback = (error: (Error|null), response?: google.cloud.channel.v1.CustomerRepricingConfig) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|deleteCustomerRepricingConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCustomerRepricingConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getChannelPartnerRepricingConfig}. + * @param error Error, if any + * @param [response] ChannelPartnerRepricingConfig + */ + type GetChannelPartnerRepricingConfigCallback = (error: (Error|null), response?: google.cloud.channel.v1.ChannelPartnerRepricingConfig) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listChannelPartnerRepricingConfigs}. + * @param error Error, if any + * @param [response] ListChannelPartnerRepricingConfigsResponse + */ + type ListChannelPartnerRepricingConfigsCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createChannelPartnerRepricingConfig}. + * @param error Error, if any + * @param [response] ChannelPartnerRepricingConfig + */ + type CreateChannelPartnerRepricingConfigCallback = (error: (Error|null), response?: google.cloud.channel.v1.ChannelPartnerRepricingConfig) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateChannelPartnerRepricingConfig}. + * @param error Error, if any + * @param [response] ChannelPartnerRepricingConfig + */ + type UpdateChannelPartnerRepricingConfigCallback = (error: (Error|null), response?: google.cloud.channel.v1.ChannelPartnerRepricingConfig) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|deleteChannelPartnerRepricingConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteChannelPartnerRepricingConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|lookupOffer}. + * @param error Error, if any + * @param [response] Offer + */ + type LookupOfferCallback = (error: (Error|null), response?: google.cloud.channel.v1.Offer) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listProducts}. + * @param error Error, if any + * @param [response] ListProductsResponse + */ + type ListProductsCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListProductsResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listSkus}. + * @param error Error, if any + * @param [response] ListSkusResponse + */ + type ListSkusCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListSkusResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listOffers}. + * @param error Error, if any + * @param [response] ListOffersResponse + */ + type ListOffersCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListOffersResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listPurchasableSkus}. + * @param error Error, if any + * @param [response] ListPurchasableSkusResponse + */ + type ListPurchasableSkusCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListPurchasableSkusResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listPurchasableOffers}. + * @param error Error, if any + * @param [response] ListPurchasableOffersResponse + */ + type ListPurchasableOffersCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListPurchasableOffersResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|registerSubscriber}. + * @param error Error, if any + * @param [response] RegisterSubscriberResponse + */ + type RegisterSubscriberCallback = (error: (Error|null), response?: google.cloud.channel.v1.RegisterSubscriberResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|unregisterSubscriber}. + * @param error Error, if any + * @param [response] UnregisterSubscriberResponse + */ + type UnregisterSubscriberCallback = (error: (Error|null), response?: google.cloud.channel.v1.UnregisterSubscriberResponse) => void; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listSubscribers}. + * @param error Error, if any + * @param [response] ListSubscribersResponse + */ + type ListSubscribersCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListSubscribersResponse) => void; + } + + /** Properties of a CheckCloudIdentityAccountsExistRequest. */ + interface ICheckCloudIdentityAccountsExistRequest { + + /** CheckCloudIdentityAccountsExistRequest parent */ + parent?: (string|null); + + /** CheckCloudIdentityAccountsExistRequest domain */ + domain?: (string|null); + } + + /** Represents a CheckCloudIdentityAccountsExistRequest. */ + class CheckCloudIdentityAccountsExistRequest implements ICheckCloudIdentityAccountsExistRequest { + + /** + * Constructs a new CheckCloudIdentityAccountsExistRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest); + + /** CheckCloudIdentityAccountsExistRequest parent. */ + public parent: string; + + /** CheckCloudIdentityAccountsExistRequest domain. */ + public domain: string; + + /** + * Creates a new CheckCloudIdentityAccountsExistRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckCloudIdentityAccountsExistRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest): google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistRequest message. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest.verify|verify} messages. + * @param message CheckCloudIdentityAccountsExistRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest.verify|verify} messages. + * @param message CheckCloudIdentityAccountsExistRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckCloudIdentityAccountsExistRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckCloudIdentityAccountsExistRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest; + + /** + * Decodes a CheckCloudIdentityAccountsExistRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckCloudIdentityAccountsExistRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest; + + /** + * Verifies a CheckCloudIdentityAccountsExistRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckCloudIdentityAccountsExistRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckCloudIdentityAccountsExistRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest; + + /** + * Creates a plain object from a CheckCloudIdentityAccountsExistRequest message. Also converts values to other types if specified. + * @param message CheckCloudIdentityAccountsExistRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckCloudIdentityAccountsExistRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckCloudIdentityAccountsExistRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudIdentityCustomerAccount. */ + interface ICloudIdentityCustomerAccount { + + /** CloudIdentityCustomerAccount existing */ + existing?: (boolean|null); + + /** CloudIdentityCustomerAccount owned */ + owned?: (boolean|null); + + /** CloudIdentityCustomerAccount customerName */ + customerName?: (string|null); + + /** CloudIdentityCustomerAccount customerCloudIdentityId */ + customerCloudIdentityId?: (string|null); + } + + /** Represents a CloudIdentityCustomerAccount. */ + class CloudIdentityCustomerAccount implements ICloudIdentityCustomerAccount { + + /** + * Constructs a new CloudIdentityCustomerAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICloudIdentityCustomerAccount); + + /** CloudIdentityCustomerAccount existing. */ + public existing: boolean; + + /** CloudIdentityCustomerAccount owned. */ + public owned: boolean; + + /** CloudIdentityCustomerAccount customerName. */ + public customerName: string; + + /** CloudIdentityCustomerAccount customerCloudIdentityId. */ + public customerCloudIdentityId: string; + + /** + * Creates a new CloudIdentityCustomerAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudIdentityCustomerAccount instance + */ + public static create(properties?: google.cloud.channel.v1.ICloudIdentityCustomerAccount): google.cloud.channel.v1.CloudIdentityCustomerAccount; + + /** + * Encodes the specified CloudIdentityCustomerAccount message. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityCustomerAccount.verify|verify} messages. + * @param message CloudIdentityCustomerAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICloudIdentityCustomerAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudIdentityCustomerAccount message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityCustomerAccount.verify|verify} messages. + * @param message CloudIdentityCustomerAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICloudIdentityCustomerAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudIdentityCustomerAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudIdentityCustomerAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CloudIdentityCustomerAccount; + + /** + * Decodes a CloudIdentityCustomerAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudIdentityCustomerAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CloudIdentityCustomerAccount; + + /** + * Verifies a CloudIdentityCustomerAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudIdentityCustomerAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudIdentityCustomerAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CloudIdentityCustomerAccount; + + /** + * Creates a plain object from a CloudIdentityCustomerAccount message. Also converts values to other types if specified. + * @param message CloudIdentityCustomerAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CloudIdentityCustomerAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudIdentityCustomerAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudIdentityCustomerAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckCloudIdentityAccountsExistResponse. */ + interface ICheckCloudIdentityAccountsExistResponse { + + /** CheckCloudIdentityAccountsExistResponse cloudIdentityAccounts */ + cloudIdentityAccounts?: (google.cloud.channel.v1.ICloudIdentityCustomerAccount[]|null); + } + + /** Represents a CheckCloudIdentityAccountsExistResponse. */ + class CheckCloudIdentityAccountsExistResponse implements ICheckCloudIdentityAccountsExistResponse { + + /** + * Constructs a new CheckCloudIdentityAccountsExistResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse); + + /** CheckCloudIdentityAccountsExistResponse cloudIdentityAccounts. */ + public cloudIdentityAccounts: google.cloud.channel.v1.ICloudIdentityCustomerAccount[]; + + /** + * Creates a new CheckCloudIdentityAccountsExistResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckCloudIdentityAccountsExistResponse instance + */ + public static create(properties?: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse): google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistResponse message. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse.verify|verify} messages. + * @param message CheckCloudIdentityAccountsExistResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse.verify|verify} messages. + * @param message CheckCloudIdentityAccountsExistResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckCloudIdentityAccountsExistResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckCloudIdentityAccountsExistResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse; + + /** + * Decodes a CheckCloudIdentityAccountsExistResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckCloudIdentityAccountsExistResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse; + + /** + * Verifies a CheckCloudIdentityAccountsExistResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckCloudIdentityAccountsExistResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckCloudIdentityAccountsExistResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse; + + /** + * Creates a plain object from a CheckCloudIdentityAccountsExistResponse message. Also converts values to other types if specified. + * @param message CheckCloudIdentityAccountsExistResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckCloudIdentityAccountsExistResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckCloudIdentityAccountsExistResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomersRequest. */ + interface IListCustomersRequest { + + /** ListCustomersRequest parent */ + parent?: (string|null); + + /** ListCustomersRequest pageSize */ + pageSize?: (number|null); + + /** ListCustomersRequest pageToken */ + pageToken?: (string|null); + + /** ListCustomersRequest filter */ + filter?: (string|null); + } + + /** Represents a ListCustomersRequest. */ + class ListCustomersRequest implements IListCustomersRequest { + + /** + * Constructs a new ListCustomersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListCustomersRequest); + + /** ListCustomersRequest parent. */ + public parent: string; + + /** ListCustomersRequest pageSize. */ + public pageSize: number; + + /** ListCustomersRequest pageToken. */ + public pageToken: string; + + /** ListCustomersRequest filter. */ + public filter: string; + + /** + * Creates a new ListCustomersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomersRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListCustomersRequest): google.cloud.channel.v1.ListCustomersRequest; + + /** + * Encodes the specified ListCustomersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListCustomersRequest.verify|verify} messages. + * @param message ListCustomersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListCustomersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomersRequest.verify|verify} messages. + * @param message ListCustomersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListCustomersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListCustomersRequest; + + /** + * Decodes a ListCustomersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListCustomersRequest; + + /** + * Verifies a ListCustomersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListCustomersRequest; + + /** + * Creates a plain object from a ListCustomersRequest message. Also converts values to other types if specified. + * @param message ListCustomersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListCustomersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomersResponse. */ + interface IListCustomersResponse { + + /** ListCustomersResponse customers */ + customers?: (google.cloud.channel.v1.ICustomer[]|null); + + /** ListCustomersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCustomersResponse. */ + class ListCustomersResponse implements IListCustomersResponse { + + /** + * Constructs a new ListCustomersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListCustomersResponse); + + /** ListCustomersResponse customers. */ + public customers: google.cloud.channel.v1.ICustomer[]; + + /** ListCustomersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCustomersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomersResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListCustomersResponse): google.cloud.channel.v1.ListCustomersResponse; + + /** + * Encodes the specified ListCustomersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListCustomersResponse.verify|verify} messages. + * @param message ListCustomersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListCustomersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomersResponse.verify|verify} messages. + * @param message ListCustomersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListCustomersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListCustomersResponse; + + /** + * Decodes a ListCustomersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListCustomersResponse; + + /** + * Verifies a ListCustomersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListCustomersResponse; + + /** + * Creates a plain object from a ListCustomersResponse message. Also converts values to other types if specified. + * @param message ListCustomersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListCustomersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCustomerRequest. */ + interface IGetCustomerRequest { + + /** GetCustomerRequest name */ + name?: (string|null); + } + + /** Represents a GetCustomerRequest. */ + class GetCustomerRequest implements IGetCustomerRequest { + + /** + * Constructs a new GetCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IGetCustomerRequest); + + /** GetCustomerRequest name. */ + public name: string; + + /** + * Creates a new GetCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCustomerRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IGetCustomerRequest): google.cloud.channel.v1.GetCustomerRequest; + + /** + * Encodes the specified GetCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRequest.verify|verify} messages. + * @param message GetCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IGetCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRequest.verify|verify} messages. + * @param message GetCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IGetCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.GetCustomerRequest; + + /** + * Decodes a GetCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.GetCustomerRequest; + + /** + * Verifies a GetCustomerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.GetCustomerRequest; + + /** + * Creates a plain object from a GetCustomerRequest message. Also converts values to other types if specified. + * @param message GetCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.GetCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCustomerRequest. */ + interface ICreateCustomerRequest { + + /** CreateCustomerRequest parent */ + parent?: (string|null); + + /** CreateCustomerRequest customer */ + customer?: (google.cloud.channel.v1.ICustomer|null); + } + + /** Represents a CreateCustomerRequest. */ + class CreateCustomerRequest implements ICreateCustomerRequest { + + /** + * Constructs a new CreateCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICreateCustomerRequest); + + /** CreateCustomerRequest parent. */ + public parent: string; + + /** CreateCustomerRequest customer. */ + public customer?: (google.cloud.channel.v1.ICustomer|null); + + /** + * Creates a new CreateCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomerRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICreateCustomerRequest): google.cloud.channel.v1.CreateCustomerRequest; + + /** + * Encodes the specified CreateCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRequest.verify|verify} messages. + * @param message CreateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICreateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRequest.verify|verify} messages. + * @param message CreateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICreateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CreateCustomerRequest; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CreateCustomerRequest; + + /** + * Verifies a CreateCustomerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CreateCustomerRequest; + + /** + * Creates a plain object from a CreateCustomerRequest message. Also converts values to other types if specified. + * @param message CreateCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CreateCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCustomerRequest. */ + interface IUpdateCustomerRequest { + + /** UpdateCustomerRequest customer */ + customer?: (google.cloud.channel.v1.ICustomer|null); + + /** UpdateCustomerRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCustomerRequest. */ + class UpdateCustomerRequest implements IUpdateCustomerRequest { + + /** + * Constructs a new UpdateCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IUpdateCustomerRequest); + + /** UpdateCustomerRequest customer. */ + public customer?: (google.cloud.channel.v1.ICustomer|null); + + /** UpdateCustomerRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomerRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IUpdateCustomerRequest): google.cloud.channel.v1.UpdateCustomerRequest; + + /** + * Encodes the specified UpdateCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRequest.verify|verify} messages. + * @param message UpdateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IUpdateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRequest.verify|verify} messages. + * @param message UpdateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IUpdateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.UpdateCustomerRequest; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.UpdateCustomerRequest; + + /** + * Verifies an UpdateCustomerRequest message. + * @param message Plain 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 UpdateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.UpdateCustomerRequest; + + /** + * Creates a plain object from an UpdateCustomerRequest message. Also converts values to other types if specified. + * @param message UpdateCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.UpdateCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomerRequest. */ + interface IDeleteCustomerRequest { + + /** DeleteCustomerRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCustomerRequest. */ + class DeleteCustomerRequest implements IDeleteCustomerRequest { + + /** + * Constructs a new DeleteCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IDeleteCustomerRequest); + + /** DeleteCustomerRequest name. */ + public name: string; + + /** + * Creates a new DeleteCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomerRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IDeleteCustomerRequest): google.cloud.channel.v1.DeleteCustomerRequest; + + /** + * Encodes the specified DeleteCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRequest.verify|verify} messages. + * @param message DeleteCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IDeleteCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRequest.verify|verify} messages. + * @param message DeleteCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IDeleteCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.DeleteCustomerRequest; + + /** + * Decodes a DeleteCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.DeleteCustomerRequest; + + /** + * Verifies a DeleteCustomerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.DeleteCustomerRequest; + + /** + * Creates a plain object from a DeleteCustomerRequest message. Also converts values to other types if specified. + * @param message DeleteCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.DeleteCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportCustomerRequest. */ + interface IImportCustomerRequest { + + /** ImportCustomerRequest domain */ + domain?: (string|null); + + /** ImportCustomerRequest cloudIdentityId */ + cloudIdentityId?: (string|null); + + /** ImportCustomerRequest parent */ + parent?: (string|null); + + /** ImportCustomerRequest authToken */ + authToken?: (string|null); + + /** ImportCustomerRequest overwriteIfExists */ + overwriteIfExists?: (boolean|null); + + /** ImportCustomerRequest channelPartnerId */ + channelPartnerId?: (string|null); + + /** ImportCustomerRequest customer */ + customer?: (string|null); + } + + /** Represents an ImportCustomerRequest. */ + class ImportCustomerRequest implements IImportCustomerRequest { + + /** + * Constructs a new ImportCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IImportCustomerRequest); + + /** ImportCustomerRequest domain. */ + public domain?: (string|null); + + /** ImportCustomerRequest cloudIdentityId. */ + public cloudIdentityId?: (string|null); + + /** ImportCustomerRequest parent. */ + public parent: string; + + /** ImportCustomerRequest authToken. */ + public authToken: string; + + /** ImportCustomerRequest overwriteIfExists. */ + public overwriteIfExists: boolean; + + /** ImportCustomerRequest channelPartnerId. */ + public channelPartnerId: string; + + /** ImportCustomerRequest customer. */ + public customer: string; + + /** ImportCustomerRequest customerIdentity. */ + public customerIdentity?: ("domain"|"cloudIdentityId"); + + /** + * Creates a new ImportCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportCustomerRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IImportCustomerRequest): google.cloud.channel.v1.ImportCustomerRequest; + + /** + * Encodes the specified ImportCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.ImportCustomerRequest.verify|verify} messages. + * @param message ImportCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IImportCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ImportCustomerRequest.verify|verify} messages. + * @param message ImportCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IImportCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ImportCustomerRequest; + + /** + * Decodes an ImportCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ImportCustomerRequest; + + /** + * Verifies an ImportCustomerRequest message. + * @param message Plain 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 ImportCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ImportCustomerRequest; + + /** + * Creates a plain object from an ImportCustomerRequest message. Also converts values to other types if specified. + * @param message ImportCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ImportCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProvisionCloudIdentityRequest. */ + interface IProvisionCloudIdentityRequest { + + /** ProvisionCloudIdentityRequest customer */ + customer?: (string|null); + + /** ProvisionCloudIdentityRequest cloudIdentityInfo */ + cloudIdentityInfo?: (google.cloud.channel.v1.ICloudIdentityInfo|null); + + /** ProvisionCloudIdentityRequest user */ + user?: (google.cloud.channel.v1.IAdminUser|null); + + /** ProvisionCloudIdentityRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a ProvisionCloudIdentityRequest. */ + class ProvisionCloudIdentityRequest implements IProvisionCloudIdentityRequest { + + /** + * Constructs a new ProvisionCloudIdentityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IProvisionCloudIdentityRequest); + + /** ProvisionCloudIdentityRequest customer. */ + public customer: string; + + /** ProvisionCloudIdentityRequest cloudIdentityInfo. */ + public cloudIdentityInfo?: (google.cloud.channel.v1.ICloudIdentityInfo|null); + + /** ProvisionCloudIdentityRequest user. */ + public user?: (google.cloud.channel.v1.IAdminUser|null); + + /** ProvisionCloudIdentityRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new ProvisionCloudIdentityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProvisionCloudIdentityRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IProvisionCloudIdentityRequest): google.cloud.channel.v1.ProvisionCloudIdentityRequest; + + /** + * Encodes the specified ProvisionCloudIdentityRequest message. Does not implicitly {@link google.cloud.channel.v1.ProvisionCloudIdentityRequest.verify|verify} messages. + * @param message ProvisionCloudIdentityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IProvisionCloudIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProvisionCloudIdentityRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ProvisionCloudIdentityRequest.verify|verify} messages. + * @param message ProvisionCloudIdentityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IProvisionCloudIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProvisionCloudIdentityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProvisionCloudIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ProvisionCloudIdentityRequest; + + /** + * Decodes a ProvisionCloudIdentityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProvisionCloudIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ProvisionCloudIdentityRequest; + + /** + * Verifies a ProvisionCloudIdentityRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProvisionCloudIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProvisionCloudIdentityRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ProvisionCloudIdentityRequest; + + /** + * Creates a plain object from a ProvisionCloudIdentityRequest message. Also converts values to other types if specified. + * @param message ProvisionCloudIdentityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ProvisionCloudIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProvisionCloudIdentityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProvisionCloudIdentityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntitlementsRequest. */ + interface IListEntitlementsRequest { + + /** ListEntitlementsRequest parent */ + parent?: (string|null); + + /** ListEntitlementsRequest pageSize */ + pageSize?: (number|null); + + /** ListEntitlementsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEntitlementsRequest. */ + class ListEntitlementsRequest implements IListEntitlementsRequest { + + /** + * Constructs a new ListEntitlementsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListEntitlementsRequest); + + /** ListEntitlementsRequest parent. */ + public parent: string; + + /** ListEntitlementsRequest pageSize. */ + public pageSize: number; + + /** ListEntitlementsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEntitlementsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntitlementsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListEntitlementsRequest): google.cloud.channel.v1.ListEntitlementsRequest; + + /** + * Encodes the specified ListEntitlementsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsRequest.verify|verify} messages. + * @param message ListEntitlementsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListEntitlementsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntitlementsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsRequest.verify|verify} messages. + * @param message ListEntitlementsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListEntitlementsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntitlementsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListEntitlementsRequest; + + /** + * Decodes a ListEntitlementsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListEntitlementsRequest; + + /** + * Verifies a ListEntitlementsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEntitlementsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntitlementsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListEntitlementsRequest; + + /** + * Creates a plain object from a ListEntitlementsRequest message. Also converts values to other types if specified. + * @param message ListEntitlementsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListEntitlementsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntitlementsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntitlementsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEntitlementsResponse. */ + interface IListEntitlementsResponse { + + /** ListEntitlementsResponse entitlements */ + entitlements?: (google.cloud.channel.v1.IEntitlement[]|null); + + /** ListEntitlementsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEntitlementsResponse. */ + class ListEntitlementsResponse implements IListEntitlementsResponse { + + /** + * Constructs a new ListEntitlementsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListEntitlementsResponse); + + /** ListEntitlementsResponse entitlements. */ + public entitlements: google.cloud.channel.v1.IEntitlement[]; + + /** ListEntitlementsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEntitlementsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntitlementsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListEntitlementsResponse): google.cloud.channel.v1.ListEntitlementsResponse; + + /** + * Encodes the specified ListEntitlementsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsResponse.verify|verify} messages. + * @param message ListEntitlementsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListEntitlementsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEntitlementsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsResponse.verify|verify} messages. + * @param message ListEntitlementsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListEntitlementsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEntitlementsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListEntitlementsResponse; + + /** + * Decodes a ListEntitlementsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListEntitlementsResponse; + + /** + * Verifies a ListEntitlementsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEntitlementsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntitlementsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListEntitlementsResponse; + + /** + * Creates a plain object from a ListEntitlementsResponse message. Also converts values to other types if specified. + * @param message ListEntitlementsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListEntitlementsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEntitlementsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEntitlementsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferableSkusRequest. */ + interface IListTransferableSkusRequest { + + /** ListTransferableSkusRequest cloudIdentityId */ + cloudIdentityId?: (string|null); + + /** ListTransferableSkusRequest customerName */ + customerName?: (string|null); + + /** ListTransferableSkusRequest parent */ + parent?: (string|null); + + /** ListTransferableSkusRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferableSkusRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferableSkusRequest authToken */ + authToken?: (string|null); + + /** ListTransferableSkusRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListTransferableSkusRequest. */ + class ListTransferableSkusRequest implements IListTransferableSkusRequest { + + /** + * Constructs a new ListTransferableSkusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListTransferableSkusRequest); + + /** ListTransferableSkusRequest cloudIdentityId. */ + public cloudIdentityId?: (string|null); + + /** ListTransferableSkusRequest customerName. */ + public customerName?: (string|null); + + /** ListTransferableSkusRequest parent. */ + public parent: string; + + /** ListTransferableSkusRequest pageSize. */ + public pageSize: number; + + /** ListTransferableSkusRequest pageToken. */ + public pageToken: string; + + /** ListTransferableSkusRequest authToken. */ + public authToken: string; + + /** ListTransferableSkusRequest languageCode. */ + public languageCode: string; + + /** ListTransferableSkusRequest transferredCustomerIdentity. */ + public transferredCustomerIdentity?: ("cloudIdentityId"|"customerName"); + + /** + * Creates a new ListTransferableSkusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferableSkusRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListTransferableSkusRequest): google.cloud.channel.v1.ListTransferableSkusRequest; + + /** + * Encodes the specified ListTransferableSkusRequest message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusRequest.verify|verify} messages. + * @param message ListTransferableSkusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListTransferableSkusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferableSkusRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusRequest.verify|verify} messages. + * @param message ListTransferableSkusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListTransferableSkusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferableSkusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListTransferableSkusRequest; + + /** + * Decodes a ListTransferableSkusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListTransferableSkusRequest; + + /** + * Verifies a ListTransferableSkusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferableSkusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferableSkusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListTransferableSkusRequest; + + /** + * Creates a plain object from a ListTransferableSkusRequest message. Also converts values to other types if specified. + * @param message ListTransferableSkusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListTransferableSkusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferableSkusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferableSkusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferableSkusResponse. */ + interface IListTransferableSkusResponse { + + /** ListTransferableSkusResponse transferableSkus */ + transferableSkus?: (google.cloud.channel.v1.ITransferableSku[]|null); + + /** ListTransferableSkusResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferableSkusResponse. */ + class ListTransferableSkusResponse implements IListTransferableSkusResponse { + + /** + * Constructs a new ListTransferableSkusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListTransferableSkusResponse); + + /** ListTransferableSkusResponse transferableSkus. */ + public transferableSkus: google.cloud.channel.v1.ITransferableSku[]; + + /** ListTransferableSkusResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferableSkusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferableSkusResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListTransferableSkusResponse): google.cloud.channel.v1.ListTransferableSkusResponse; + + /** + * Encodes the specified ListTransferableSkusResponse message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusResponse.verify|verify} messages. + * @param message ListTransferableSkusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListTransferableSkusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferableSkusResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusResponse.verify|verify} messages. + * @param message ListTransferableSkusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListTransferableSkusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferableSkusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListTransferableSkusResponse; + + /** + * Decodes a ListTransferableSkusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListTransferableSkusResponse; + + /** + * Verifies a ListTransferableSkusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferableSkusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferableSkusResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListTransferableSkusResponse; + + /** + * Creates a plain object from a ListTransferableSkusResponse message. Also converts values to other types if specified. + * @param message ListTransferableSkusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListTransferableSkusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferableSkusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferableSkusResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferableOffersRequest. */ + interface IListTransferableOffersRequest { + + /** ListTransferableOffersRequest cloudIdentityId */ + cloudIdentityId?: (string|null); + + /** ListTransferableOffersRequest customerName */ + customerName?: (string|null); + + /** ListTransferableOffersRequest parent */ + parent?: (string|null); + + /** ListTransferableOffersRequest pageSize */ + pageSize?: (number|null); + + /** ListTransferableOffersRequest pageToken */ + pageToken?: (string|null); + + /** ListTransferableOffersRequest sku */ + sku?: (string|null); + + /** ListTransferableOffersRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListTransferableOffersRequest. */ + class ListTransferableOffersRequest implements IListTransferableOffersRequest { + + /** + * Constructs a new ListTransferableOffersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListTransferableOffersRequest); + + /** ListTransferableOffersRequest cloudIdentityId. */ + public cloudIdentityId?: (string|null); + + /** ListTransferableOffersRequest customerName. */ + public customerName?: (string|null); + + /** ListTransferableOffersRequest parent. */ + public parent: string; + + /** ListTransferableOffersRequest pageSize. */ + public pageSize: number; + + /** ListTransferableOffersRequest pageToken. */ + public pageToken: string; + + /** ListTransferableOffersRequest sku. */ + public sku: string; + + /** ListTransferableOffersRequest languageCode. */ + public languageCode: string; + + /** ListTransferableOffersRequest transferredCustomerIdentity. */ + public transferredCustomerIdentity?: ("cloudIdentityId"|"customerName"); + + /** + * Creates a new ListTransferableOffersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferableOffersRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListTransferableOffersRequest): google.cloud.channel.v1.ListTransferableOffersRequest; + + /** + * Encodes the specified ListTransferableOffersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersRequest.verify|verify} messages. + * @param message ListTransferableOffersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListTransferableOffersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferableOffersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersRequest.verify|verify} messages. + * @param message ListTransferableOffersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListTransferableOffersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferableOffersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListTransferableOffersRequest; + + /** + * Decodes a ListTransferableOffersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListTransferableOffersRequest; + + /** + * Verifies a ListTransferableOffersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferableOffersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferableOffersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListTransferableOffersRequest; + + /** + * Creates a plain object from a ListTransferableOffersRequest message. Also converts values to other types if specified. + * @param message ListTransferableOffersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListTransferableOffersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferableOffersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferableOffersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTransferableOffersResponse. */ + interface IListTransferableOffersResponse { + + /** ListTransferableOffersResponse transferableOffers */ + transferableOffers?: (google.cloud.channel.v1.ITransferableOffer[]|null); + + /** ListTransferableOffersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTransferableOffersResponse. */ + class ListTransferableOffersResponse implements IListTransferableOffersResponse { + + /** + * Constructs a new ListTransferableOffersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListTransferableOffersResponse); + + /** ListTransferableOffersResponse transferableOffers. */ + public transferableOffers: google.cloud.channel.v1.ITransferableOffer[]; + + /** ListTransferableOffersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTransferableOffersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTransferableOffersResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListTransferableOffersResponse): google.cloud.channel.v1.ListTransferableOffersResponse; + + /** + * Encodes the specified ListTransferableOffersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersResponse.verify|verify} messages. + * @param message ListTransferableOffersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListTransferableOffersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTransferableOffersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersResponse.verify|verify} messages. + * @param message ListTransferableOffersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListTransferableOffersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTransferableOffersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTransferableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListTransferableOffersResponse; + + /** + * Decodes a ListTransferableOffersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTransferableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListTransferableOffersResponse; + + /** + * Verifies a ListTransferableOffersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTransferableOffersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTransferableOffersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListTransferableOffersResponse; + + /** + * Creates a plain object from a ListTransferableOffersResponse message. Also converts values to other types if specified. + * @param message ListTransferableOffersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListTransferableOffersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTransferableOffersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTransferableOffersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferableOffer. */ + interface ITransferableOffer { + + /** TransferableOffer offer */ + offer?: (google.cloud.channel.v1.IOffer|null); + } + + /** Represents a TransferableOffer. */ + class TransferableOffer implements ITransferableOffer { + + /** + * Constructs a new TransferableOffer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITransferableOffer); + + /** TransferableOffer offer. */ + public offer?: (google.cloud.channel.v1.IOffer|null); + + /** + * Creates a new TransferableOffer instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferableOffer instance + */ + public static create(properties?: google.cloud.channel.v1.ITransferableOffer): google.cloud.channel.v1.TransferableOffer; + + /** + * Encodes the specified TransferableOffer message. Does not implicitly {@link google.cloud.channel.v1.TransferableOffer.verify|verify} messages. + * @param message TransferableOffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITransferableOffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferableOffer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferableOffer.verify|verify} messages. + * @param message TransferableOffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITransferableOffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferableOffer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TransferableOffer; + + /** + * Decodes a TransferableOffer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TransferableOffer; + + /** + * Verifies a TransferableOffer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferableOffer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferableOffer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TransferableOffer; + + /** + * Creates a plain object from a TransferableOffer message. Also converts values to other types if specified. + * @param message TransferableOffer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TransferableOffer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferableOffer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferableOffer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEntitlementRequest. */ + interface IGetEntitlementRequest { + + /** GetEntitlementRequest name */ + name?: (string|null); + } + + /** Represents a GetEntitlementRequest. */ + class GetEntitlementRequest implements IGetEntitlementRequest { + + /** + * Constructs a new GetEntitlementRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IGetEntitlementRequest); + + /** GetEntitlementRequest name. */ + public name: string; + + /** + * Creates a new GetEntitlementRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEntitlementRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IGetEntitlementRequest): google.cloud.channel.v1.GetEntitlementRequest; + + /** + * Encodes the specified GetEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.GetEntitlementRequest.verify|verify} messages. + * @param message GetEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IGetEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetEntitlementRequest.verify|verify} messages. + * @param message GetEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IGetEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEntitlementRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.GetEntitlementRequest; + + /** + * Decodes a GetEntitlementRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.GetEntitlementRequest; + + /** + * Verifies a GetEntitlementRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEntitlementRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.GetEntitlementRequest; + + /** + * Creates a plain object from a GetEntitlementRequest message. Also converts values to other types if specified. + * @param message GetEntitlementRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.GetEntitlementRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEntitlementRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEntitlementRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelPartnerLinksRequest. */ + interface IListChannelPartnerLinksRequest { + + /** ListChannelPartnerLinksRequest parent */ + parent?: (string|null); + + /** ListChannelPartnerLinksRequest pageSize */ + pageSize?: (number|null); + + /** ListChannelPartnerLinksRequest pageToken */ + pageToken?: (string|null); + + /** ListChannelPartnerLinksRequest view */ + view?: (google.cloud.channel.v1.ChannelPartnerLinkView|keyof typeof google.cloud.channel.v1.ChannelPartnerLinkView|null); + } + + /** Represents a ListChannelPartnerLinksRequest. */ + class ListChannelPartnerLinksRequest implements IListChannelPartnerLinksRequest { + + /** + * Constructs a new ListChannelPartnerLinksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListChannelPartnerLinksRequest); + + /** ListChannelPartnerLinksRequest parent. */ + public parent: string; + + /** ListChannelPartnerLinksRequest pageSize. */ + public pageSize: number; + + /** ListChannelPartnerLinksRequest pageToken. */ + public pageToken: string; + + /** ListChannelPartnerLinksRequest view. */ + public view: (google.cloud.channel.v1.ChannelPartnerLinkView|keyof typeof google.cloud.channel.v1.ChannelPartnerLinkView); + + /** + * Creates a new ListChannelPartnerLinksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelPartnerLinksRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListChannelPartnerLinksRequest): google.cloud.channel.v1.ListChannelPartnerLinksRequest; + + /** + * Encodes the specified ListChannelPartnerLinksRequest message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksRequest.verify|verify} messages. + * @param message ListChannelPartnerLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListChannelPartnerLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChannelPartnerLinksRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksRequest.verify|verify} messages. + * @param message ListChannelPartnerLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListChannelPartnerLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChannelPartnerLinksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListChannelPartnerLinksRequest; + + /** + * Decodes a ListChannelPartnerLinksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListChannelPartnerLinksRequest; + + /** + * Verifies a ListChannelPartnerLinksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChannelPartnerLinksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelPartnerLinksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListChannelPartnerLinksRequest; + + /** + * Creates a plain object from a ListChannelPartnerLinksRequest message. Also converts values to other types if specified. + * @param message ListChannelPartnerLinksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListChannelPartnerLinksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChannelPartnerLinksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelPartnerLinksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelPartnerLinksResponse. */ + interface IListChannelPartnerLinksResponse { + + /** ListChannelPartnerLinksResponse channelPartnerLinks */ + channelPartnerLinks?: (google.cloud.channel.v1.IChannelPartnerLink[]|null); + + /** ListChannelPartnerLinksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChannelPartnerLinksResponse. */ + class ListChannelPartnerLinksResponse implements IListChannelPartnerLinksResponse { + + /** + * Constructs a new ListChannelPartnerLinksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListChannelPartnerLinksResponse); + + /** ListChannelPartnerLinksResponse channelPartnerLinks. */ + public channelPartnerLinks: google.cloud.channel.v1.IChannelPartnerLink[]; + + /** ListChannelPartnerLinksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChannelPartnerLinksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelPartnerLinksResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListChannelPartnerLinksResponse): google.cloud.channel.v1.ListChannelPartnerLinksResponse; + + /** + * Encodes the specified ListChannelPartnerLinksResponse message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.verify|verify} messages. + * @param message ListChannelPartnerLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListChannelPartnerLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChannelPartnerLinksResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.verify|verify} messages. + * @param message ListChannelPartnerLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListChannelPartnerLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChannelPartnerLinksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListChannelPartnerLinksResponse; + + /** + * Decodes a ListChannelPartnerLinksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListChannelPartnerLinksResponse; + + /** + * Verifies a ListChannelPartnerLinksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChannelPartnerLinksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelPartnerLinksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListChannelPartnerLinksResponse; + + /** + * Creates a plain object from a ListChannelPartnerLinksResponse message. Also converts values to other types if specified. + * @param message ListChannelPartnerLinksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListChannelPartnerLinksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChannelPartnerLinksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelPartnerLinksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChannelPartnerLinkRequest. */ + interface IGetChannelPartnerLinkRequest { + + /** GetChannelPartnerLinkRequest name */ + name?: (string|null); + + /** GetChannelPartnerLinkRequest view */ + view?: (google.cloud.channel.v1.ChannelPartnerLinkView|keyof typeof google.cloud.channel.v1.ChannelPartnerLinkView|null); + } + + /** Represents a GetChannelPartnerLinkRequest. */ + class GetChannelPartnerLinkRequest implements IGetChannelPartnerLinkRequest { + + /** + * Constructs a new GetChannelPartnerLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IGetChannelPartnerLinkRequest); + + /** GetChannelPartnerLinkRequest name. */ + public name: string; + + /** GetChannelPartnerLinkRequest view. */ + public view: (google.cloud.channel.v1.ChannelPartnerLinkView|keyof typeof google.cloud.channel.v1.ChannelPartnerLinkView); + + /** + * Creates a new GetChannelPartnerLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChannelPartnerLinkRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IGetChannelPartnerLinkRequest): google.cloud.channel.v1.GetChannelPartnerLinkRequest; + + /** + * Encodes the specified GetChannelPartnerLinkRequest message. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerLinkRequest.verify|verify} messages. + * @param message GetChannelPartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IGetChannelPartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChannelPartnerLinkRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerLinkRequest.verify|verify} messages. + * @param message GetChannelPartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IGetChannelPartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChannelPartnerLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.GetChannelPartnerLinkRequest; + + /** + * Decodes a GetChannelPartnerLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.GetChannelPartnerLinkRequest; + + /** + * Verifies a GetChannelPartnerLinkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChannelPartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChannelPartnerLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.GetChannelPartnerLinkRequest; + + /** + * Creates a plain object from a GetChannelPartnerLinkRequest message. Also converts values to other types if specified. + * @param message GetChannelPartnerLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.GetChannelPartnerLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChannelPartnerLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChannelPartnerLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateChannelPartnerLinkRequest. */ + interface ICreateChannelPartnerLinkRequest { + + /** CreateChannelPartnerLinkRequest parent */ + parent?: (string|null); + + /** CreateChannelPartnerLinkRequest channelPartnerLink */ + channelPartnerLink?: (google.cloud.channel.v1.IChannelPartnerLink|null); + } + + /** Represents a CreateChannelPartnerLinkRequest. */ + class CreateChannelPartnerLinkRequest implements ICreateChannelPartnerLinkRequest { + + /** + * Constructs a new CreateChannelPartnerLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICreateChannelPartnerLinkRequest); + + /** CreateChannelPartnerLinkRequest parent. */ + public parent: string; + + /** CreateChannelPartnerLinkRequest channelPartnerLink. */ + public channelPartnerLink?: (google.cloud.channel.v1.IChannelPartnerLink|null); + + /** + * Creates a new CreateChannelPartnerLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateChannelPartnerLinkRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICreateChannelPartnerLinkRequest): google.cloud.channel.v1.CreateChannelPartnerLinkRequest; + + /** + * Encodes the specified CreateChannelPartnerLinkRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerLinkRequest.verify|verify} messages. + * @param message CreateChannelPartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateChannelPartnerLinkRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerLinkRequest.verify|verify} messages. + * @param message CreateChannelPartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateChannelPartnerLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CreateChannelPartnerLinkRequest; + + /** + * Decodes a CreateChannelPartnerLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CreateChannelPartnerLinkRequest; + + /** + * Verifies a CreateChannelPartnerLinkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateChannelPartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateChannelPartnerLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CreateChannelPartnerLinkRequest; + + /** + * Creates a plain object from a CreateChannelPartnerLinkRequest message. Also converts values to other types if specified. + * @param message CreateChannelPartnerLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CreateChannelPartnerLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateChannelPartnerLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateChannelPartnerLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelPartnerLinkRequest. */ + interface IUpdateChannelPartnerLinkRequest { + + /** UpdateChannelPartnerLinkRequest name */ + name?: (string|null); + + /** UpdateChannelPartnerLinkRequest channelPartnerLink */ + channelPartnerLink?: (google.cloud.channel.v1.IChannelPartnerLink|null); + + /** UpdateChannelPartnerLinkRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateChannelPartnerLinkRequest. */ + class UpdateChannelPartnerLinkRequest implements IUpdateChannelPartnerLinkRequest { + + /** + * Constructs a new UpdateChannelPartnerLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest); + + /** UpdateChannelPartnerLinkRequest name. */ + public name: string; + + /** UpdateChannelPartnerLinkRequest channelPartnerLink. */ + public channelPartnerLink?: (google.cloud.channel.v1.IChannelPartnerLink|null); + + /** UpdateChannelPartnerLinkRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateChannelPartnerLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChannelPartnerLinkRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest): google.cloud.channel.v1.UpdateChannelPartnerLinkRequest; + + /** + * Encodes the specified UpdateChannelPartnerLinkRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerLinkRequest.verify|verify} messages. + * @param message UpdateChannelPartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateChannelPartnerLinkRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerLinkRequest.verify|verify} messages. + * @param message UpdateChannelPartnerLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateChannelPartnerLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.UpdateChannelPartnerLinkRequest; + + /** + * Decodes an UpdateChannelPartnerLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.UpdateChannelPartnerLinkRequest; + + /** + * Verifies an UpdateChannelPartnerLinkRequest message. + * @param message Plain 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 UpdateChannelPartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChannelPartnerLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.UpdateChannelPartnerLinkRequest; + + /** + * Creates a plain object from an UpdateChannelPartnerLinkRequest message. Also converts values to other types if specified. + * @param message UpdateChannelPartnerLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.UpdateChannelPartnerLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateChannelPartnerLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChannelPartnerLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCustomerRepricingConfigRequest. */ + interface IGetCustomerRepricingConfigRequest { + + /** GetCustomerRepricingConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetCustomerRepricingConfigRequest. */ + class GetCustomerRepricingConfigRequest implements IGetCustomerRepricingConfigRequest { + + /** + * Constructs a new GetCustomerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IGetCustomerRepricingConfigRequest); + + /** GetCustomerRepricingConfigRequest name. */ + public name: string; + + /** + * Creates a new GetCustomerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCustomerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IGetCustomerRepricingConfigRequest): google.cloud.channel.v1.GetCustomerRepricingConfigRequest; + + /** + * Encodes the specified GetCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRepricingConfigRequest.verify|verify} messages. + * @param message GetCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRepricingConfigRequest.verify|verify} messages. + * @param message GetCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCustomerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.GetCustomerRepricingConfigRequest; + + /** + * Decodes a GetCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.GetCustomerRepricingConfigRequest; + + /** + * Verifies a GetCustomerRepricingConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCustomerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.GetCustomerRepricingConfigRequest; + + /** + * Creates a plain object from a GetCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message GetCustomerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.GetCustomerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCustomerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCustomerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomerRepricingConfigsRequest. */ + interface IListCustomerRepricingConfigsRequest { + + /** ListCustomerRepricingConfigsRequest parent */ + parent?: (string|null); + + /** ListCustomerRepricingConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListCustomerRepricingConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListCustomerRepricingConfigsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListCustomerRepricingConfigsRequest. */ + class ListCustomerRepricingConfigsRequest implements IListCustomerRepricingConfigsRequest { + + /** + * Constructs a new ListCustomerRepricingConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListCustomerRepricingConfigsRequest); + + /** ListCustomerRepricingConfigsRequest parent. */ + public parent: string; + + /** ListCustomerRepricingConfigsRequest pageSize. */ + public pageSize: number; + + /** ListCustomerRepricingConfigsRequest pageToken. */ + public pageToken: string; + + /** ListCustomerRepricingConfigsRequest filter. */ + public filter: string; + + /** + * Creates a new ListCustomerRepricingConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomerRepricingConfigsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListCustomerRepricingConfigsRequest): google.cloud.channel.v1.ListCustomerRepricingConfigsRequest; + + /** + * Encodes the specified ListCustomerRepricingConfigsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsRequest.verify|verify} messages. + * @param message ListCustomerRepricingConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomerRepricingConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsRequest.verify|verify} messages. + * @param message ListCustomerRepricingConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomerRepricingConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListCustomerRepricingConfigsRequest; + + /** + * Decodes a ListCustomerRepricingConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListCustomerRepricingConfigsRequest; + + /** + * Verifies a ListCustomerRepricingConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomerRepricingConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomerRepricingConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListCustomerRepricingConfigsRequest; + + /** + * Creates a plain object from a ListCustomerRepricingConfigsRequest message. Also converts values to other types if specified. + * @param message ListCustomerRepricingConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListCustomerRepricingConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomerRepricingConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomerRepricingConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCustomerRepricingConfigsResponse. */ + interface IListCustomerRepricingConfigsResponse { + + /** ListCustomerRepricingConfigsResponse customerRepricingConfigs */ + customerRepricingConfigs?: (google.cloud.channel.v1.ICustomerRepricingConfig[]|null); + + /** ListCustomerRepricingConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCustomerRepricingConfigsResponse. */ + class ListCustomerRepricingConfigsResponse implements IListCustomerRepricingConfigsResponse { + + /** + * Constructs a new ListCustomerRepricingConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListCustomerRepricingConfigsResponse); + + /** ListCustomerRepricingConfigsResponse customerRepricingConfigs. */ + public customerRepricingConfigs: google.cloud.channel.v1.ICustomerRepricingConfig[]; + + /** ListCustomerRepricingConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCustomerRepricingConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCustomerRepricingConfigsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListCustomerRepricingConfigsResponse): google.cloud.channel.v1.ListCustomerRepricingConfigsResponse; + + /** + * Encodes the specified ListCustomerRepricingConfigsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.verify|verify} messages. + * @param message ListCustomerRepricingConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListCustomerRepricingConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCustomerRepricingConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.verify|verify} messages. + * @param message ListCustomerRepricingConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListCustomerRepricingConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCustomerRepricingConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCustomerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListCustomerRepricingConfigsResponse; + + /** + * Decodes a ListCustomerRepricingConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCustomerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListCustomerRepricingConfigsResponse; + + /** + * Verifies a ListCustomerRepricingConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCustomerRepricingConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCustomerRepricingConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListCustomerRepricingConfigsResponse; + + /** + * Creates a plain object from a ListCustomerRepricingConfigsResponse message. Also converts values to other types if specified. + * @param message ListCustomerRepricingConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListCustomerRepricingConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCustomerRepricingConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCustomerRepricingConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCustomerRepricingConfigRequest. */ + interface ICreateCustomerRepricingConfigRequest { + + /** CreateCustomerRepricingConfigRequest parent */ + parent?: (string|null); + + /** CreateCustomerRepricingConfigRequest customerRepricingConfig */ + customerRepricingConfig?: (google.cloud.channel.v1.ICustomerRepricingConfig|null); + } + + /** Represents a CreateCustomerRepricingConfigRequest. */ + class CreateCustomerRepricingConfigRequest implements ICreateCustomerRepricingConfigRequest { + + /** + * Constructs a new CreateCustomerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest); + + /** CreateCustomerRepricingConfigRequest parent. */ + public parent: string; + + /** CreateCustomerRepricingConfigRequest customerRepricingConfig. */ + public customerRepricingConfig?: (google.cloud.channel.v1.ICustomerRepricingConfig|null); + + /** + * Creates a new CreateCustomerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest): google.cloud.channel.v1.CreateCustomerRepricingConfigRequest; + + /** + * Encodes the specified CreateCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRepricingConfigRequest.verify|verify} messages. + * @param message CreateCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRepricingConfigRequest.verify|verify} messages. + * @param message CreateCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CreateCustomerRepricingConfigRequest; + + /** + * Decodes a CreateCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CreateCustomerRepricingConfigRequest; + + /** + * Verifies a CreateCustomerRepricingConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CreateCustomerRepricingConfigRequest; + + /** + * Creates a plain object from a CreateCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message CreateCustomerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CreateCustomerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCustomerRepricingConfigRequest. */ + interface IUpdateCustomerRepricingConfigRequest { + + /** UpdateCustomerRepricingConfigRequest customerRepricingConfig */ + customerRepricingConfig?: (google.cloud.channel.v1.ICustomerRepricingConfig|null); + } + + /** Represents an UpdateCustomerRepricingConfigRequest. */ + class UpdateCustomerRepricingConfigRequest implements IUpdateCustomerRepricingConfigRequest { + + /** + * Constructs a new UpdateCustomerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest); + + /** UpdateCustomerRepricingConfigRequest customerRepricingConfig. */ + public customerRepricingConfig?: (google.cloud.channel.v1.ICustomerRepricingConfig|null); + + /** + * Creates a new UpdateCustomerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest): google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest; + + /** + * Encodes the specified UpdateCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest.verify|verify} messages. + * @param message UpdateCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest.verify|verify} messages. + * @param message UpdateCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest; + + /** + * Decodes an UpdateCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest; + + /** + * Verifies an UpdateCustomerRepricingConfigRequest message. + * @param message Plain 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 UpdateCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest; + + /** + * Creates a plain object from an UpdateCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message UpdateCustomerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomerRepricingConfigRequest. */ + interface IDeleteCustomerRepricingConfigRequest { + + /** DeleteCustomerRepricingConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCustomerRepricingConfigRequest. */ + class DeleteCustomerRepricingConfigRequest implements IDeleteCustomerRepricingConfigRequest { + + /** + * Constructs a new DeleteCustomerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest); + + /** DeleteCustomerRepricingConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteCustomerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest): google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest; + + /** + * Encodes the specified DeleteCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest.verify|verify} messages. + * @param message DeleteCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest.verify|verify} messages. + * @param message DeleteCustomerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest; + + /** + * Decodes a DeleteCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest; + + /** + * Verifies a DeleteCustomerRepricingConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest; + + /** + * Creates a plain object from a DeleteCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message DeleteCustomerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChannelPartnerRepricingConfigRequest. */ + interface IGetChannelPartnerRepricingConfigRequest { + + /** GetChannelPartnerRepricingConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetChannelPartnerRepricingConfigRequest. */ + class GetChannelPartnerRepricingConfigRequest implements IGetChannelPartnerRepricingConfigRequest { + + /** + * Constructs a new GetChannelPartnerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest); + + /** GetChannelPartnerRepricingConfigRequest name. */ + public name: string; + + /** + * Creates a new GetChannelPartnerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChannelPartnerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest): google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest; + + /** + * Encodes the specified GetChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message GetChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message GetChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest; + + /** + * Decodes a GetChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest; + + /** + * Verifies a GetChannelPartnerRepricingConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChannelPartnerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest; + + /** + * Creates a plain object from a GetChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message GetChannelPartnerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChannelPartnerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChannelPartnerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelPartnerRepricingConfigsRequest. */ + interface IListChannelPartnerRepricingConfigsRequest { + + /** ListChannelPartnerRepricingConfigsRequest parent */ + parent?: (string|null); + + /** ListChannelPartnerRepricingConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListChannelPartnerRepricingConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListChannelPartnerRepricingConfigsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListChannelPartnerRepricingConfigsRequest. */ + class ListChannelPartnerRepricingConfigsRequest implements IListChannelPartnerRepricingConfigsRequest { + + /** + * Constructs a new ListChannelPartnerRepricingConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest); + + /** ListChannelPartnerRepricingConfigsRequest parent. */ + public parent: string; + + /** ListChannelPartnerRepricingConfigsRequest pageSize. */ + public pageSize: number; + + /** ListChannelPartnerRepricingConfigsRequest pageToken. */ + public pageToken: string; + + /** ListChannelPartnerRepricingConfigsRequest filter. */ + public filter: string; + + /** + * Creates a new ListChannelPartnerRepricingConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelPartnerRepricingConfigsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest.verify|verify} messages. + * @param message ListChannelPartnerRepricingConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest.verify|verify} messages. + * @param message ListChannelPartnerRepricingConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChannelPartnerRepricingConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelPartnerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest; + + /** + * Decodes a ListChannelPartnerRepricingConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelPartnerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest; + + /** + * Verifies a ListChannelPartnerRepricingConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChannelPartnerRepricingConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelPartnerRepricingConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest; + + /** + * Creates a plain object from a ListChannelPartnerRepricingConfigsRequest message. Also converts values to other types if specified. + * @param message ListChannelPartnerRepricingConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChannelPartnerRepricingConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelPartnerRepricingConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelPartnerRepricingConfigsResponse. */ + interface IListChannelPartnerRepricingConfigsResponse { + + /** ListChannelPartnerRepricingConfigsResponse channelPartnerRepricingConfigs */ + channelPartnerRepricingConfigs?: (google.cloud.channel.v1.IChannelPartnerRepricingConfig[]|null); + + /** ListChannelPartnerRepricingConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChannelPartnerRepricingConfigsResponse. */ + class ListChannelPartnerRepricingConfigsResponse implements IListChannelPartnerRepricingConfigsResponse { + + /** + * Constructs a new ListChannelPartnerRepricingConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse); + + /** ListChannelPartnerRepricingConfigsResponse channelPartnerRepricingConfigs. */ + public channelPartnerRepricingConfigs: google.cloud.channel.v1.IChannelPartnerRepricingConfig[]; + + /** ListChannelPartnerRepricingConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChannelPartnerRepricingConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelPartnerRepricingConfigsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.verify|verify} messages. + * @param message ListChannelPartnerRepricingConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.verify|verify} messages. + * @param message ListChannelPartnerRepricingConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChannelPartnerRepricingConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelPartnerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse; + + /** + * Decodes a ListChannelPartnerRepricingConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelPartnerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse; + + /** + * Verifies a ListChannelPartnerRepricingConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChannelPartnerRepricingConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelPartnerRepricingConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse; + + /** + * Creates a plain object from a ListChannelPartnerRepricingConfigsResponse message. Also converts values to other types if specified. + * @param message ListChannelPartnerRepricingConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChannelPartnerRepricingConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelPartnerRepricingConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateChannelPartnerRepricingConfigRequest. */ + interface ICreateChannelPartnerRepricingConfigRequest { + + /** CreateChannelPartnerRepricingConfigRequest parent */ + parent?: (string|null); + + /** CreateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig */ + channelPartnerRepricingConfig?: (google.cloud.channel.v1.IChannelPartnerRepricingConfig|null); + } + + /** Represents a CreateChannelPartnerRepricingConfigRequest. */ + class CreateChannelPartnerRepricingConfigRequest implements ICreateChannelPartnerRepricingConfigRequest { + + /** + * Constructs a new CreateChannelPartnerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest); + + /** CreateChannelPartnerRepricingConfigRequest parent. */ + public parent: string; + + /** CreateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig. */ + public channelPartnerRepricingConfig?: (google.cloud.channel.v1.IChannelPartnerRepricingConfig|null); + + /** + * Creates a new CreateChannelPartnerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateChannelPartnerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest): google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest; + + /** + * Encodes the specified CreateChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message CreateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message CreateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest; + + /** + * Decodes a CreateChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest; + + /** + * Verifies a CreateChannelPartnerRepricingConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateChannelPartnerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest; + + /** + * Creates a plain object from a CreateChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message CreateChannelPartnerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateChannelPartnerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateChannelPartnerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelPartnerRepricingConfigRequest. */ + interface IUpdateChannelPartnerRepricingConfigRequest { + + /** UpdateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig */ + channelPartnerRepricingConfig?: (google.cloud.channel.v1.IChannelPartnerRepricingConfig|null); + } + + /** Represents an UpdateChannelPartnerRepricingConfigRequest. */ + class UpdateChannelPartnerRepricingConfigRequest implements IUpdateChannelPartnerRepricingConfigRequest { + + /** + * Constructs a new UpdateChannelPartnerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest); + + /** UpdateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig. */ + public channelPartnerRepricingConfig?: (google.cloud.channel.v1.IChannelPartnerRepricingConfig|null); + + /** + * Creates a new UpdateChannelPartnerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChannelPartnerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest): google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest; + + /** + * Encodes the specified UpdateChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message UpdateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message UpdateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest; + + /** + * Decodes an UpdateChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest; + + /** + * Verifies an UpdateChannelPartnerRepricingConfigRequest message. + * @param message Plain 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 UpdateChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChannelPartnerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest; + + /** + * Creates a plain object from an UpdateChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message UpdateChannelPartnerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateChannelPartnerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChannelPartnerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteChannelPartnerRepricingConfigRequest. */ + interface IDeleteChannelPartnerRepricingConfigRequest { + + /** DeleteChannelPartnerRepricingConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteChannelPartnerRepricingConfigRequest. */ + class DeleteChannelPartnerRepricingConfigRequest implements IDeleteChannelPartnerRepricingConfigRequest { + + /** + * Constructs a new DeleteChannelPartnerRepricingConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest); + + /** DeleteChannelPartnerRepricingConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteChannelPartnerRepricingConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteChannelPartnerRepricingConfigRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest): google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest; + + /** + * Encodes the specified DeleteChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message DeleteChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @param message DeleteChannelPartnerRepricingConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest; + + /** + * Decodes a DeleteChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest; + + /** + * Verifies a DeleteChannelPartnerRepricingConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteChannelPartnerRepricingConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest; + + /** + * Creates a plain object from a DeleteChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @param message DeleteChannelPartnerRepricingConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteChannelPartnerRepricingConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteChannelPartnerRepricingConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEntitlementRequest. */ + interface ICreateEntitlementRequest { + + /** CreateEntitlementRequest parent */ + parent?: (string|null); + + /** CreateEntitlementRequest entitlement */ + entitlement?: (google.cloud.channel.v1.IEntitlement|null); + + /** CreateEntitlementRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateEntitlementRequest. */ + class CreateEntitlementRequest implements ICreateEntitlementRequest { + + /** + * Constructs a new CreateEntitlementRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICreateEntitlementRequest); + + /** CreateEntitlementRequest parent. */ + public parent: string; + + /** CreateEntitlementRequest entitlement. */ + public entitlement?: (google.cloud.channel.v1.IEntitlement|null); + + /** CreateEntitlementRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateEntitlementRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntitlementRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICreateEntitlementRequest): google.cloud.channel.v1.CreateEntitlementRequest; + + /** + * Encodes the specified CreateEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateEntitlementRequest.verify|verify} messages. + * @param message CreateEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICreateEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateEntitlementRequest.verify|verify} messages. + * @param message CreateEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICreateEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEntitlementRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CreateEntitlementRequest; + + /** + * Decodes a CreateEntitlementRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CreateEntitlementRequest; + + /** + * Verifies a CreateEntitlementRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntitlementRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CreateEntitlementRequest; + + /** + * Creates a plain object from a CreateEntitlementRequest message. Also converts values to other types if specified. + * @param message CreateEntitlementRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CreateEntitlementRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEntitlementRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEntitlementRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferEntitlementsRequest. */ + interface ITransferEntitlementsRequest { + + /** TransferEntitlementsRequest parent */ + parent?: (string|null); + + /** TransferEntitlementsRequest entitlements */ + entitlements?: (google.cloud.channel.v1.IEntitlement[]|null); + + /** TransferEntitlementsRequest authToken */ + authToken?: (string|null); + + /** TransferEntitlementsRequest requestId */ + requestId?: (string|null); + } + + /** Represents a TransferEntitlementsRequest. */ + class TransferEntitlementsRequest implements ITransferEntitlementsRequest { + + /** + * Constructs a new TransferEntitlementsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITransferEntitlementsRequest); + + /** TransferEntitlementsRequest parent. */ + public parent: string; + + /** TransferEntitlementsRequest entitlements. */ + public entitlements: google.cloud.channel.v1.IEntitlement[]; + + /** TransferEntitlementsRequest authToken. */ + public authToken: string; + + /** TransferEntitlementsRequest requestId. */ + public requestId: string; + + /** + * Creates a new TransferEntitlementsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferEntitlementsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ITransferEntitlementsRequest): google.cloud.channel.v1.TransferEntitlementsRequest; + + /** + * Encodes the specified TransferEntitlementsRequest message. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsRequest.verify|verify} messages. + * @param message TransferEntitlementsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITransferEntitlementsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferEntitlementsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsRequest.verify|verify} messages. + * @param message TransferEntitlementsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITransferEntitlementsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferEntitlementsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TransferEntitlementsRequest; + + /** + * Decodes a TransferEntitlementsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TransferEntitlementsRequest; + + /** + * Verifies a TransferEntitlementsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferEntitlementsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferEntitlementsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TransferEntitlementsRequest; + + /** + * Creates a plain object from a TransferEntitlementsRequest message. Also converts values to other types if specified. + * @param message TransferEntitlementsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TransferEntitlementsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferEntitlementsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferEntitlementsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferEntitlementsResponse. */ + interface ITransferEntitlementsResponse { + + /** TransferEntitlementsResponse entitlements */ + entitlements?: (google.cloud.channel.v1.IEntitlement[]|null); + } + + /** Represents a TransferEntitlementsResponse. */ + class TransferEntitlementsResponse implements ITransferEntitlementsResponse { + + /** + * Constructs a new TransferEntitlementsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITransferEntitlementsResponse); + + /** TransferEntitlementsResponse entitlements. */ + public entitlements: google.cloud.channel.v1.IEntitlement[]; + + /** + * Creates a new TransferEntitlementsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferEntitlementsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.ITransferEntitlementsResponse): google.cloud.channel.v1.TransferEntitlementsResponse; + + /** + * Encodes the specified TransferEntitlementsResponse message. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsResponse.verify|verify} messages. + * @param message TransferEntitlementsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITransferEntitlementsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferEntitlementsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsResponse.verify|verify} messages. + * @param message TransferEntitlementsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITransferEntitlementsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferEntitlementsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TransferEntitlementsResponse; + + /** + * Decodes a TransferEntitlementsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TransferEntitlementsResponse; + + /** + * Verifies a TransferEntitlementsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferEntitlementsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferEntitlementsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TransferEntitlementsResponse; + + /** + * Creates a plain object from a TransferEntitlementsResponse message. Also converts values to other types if specified. + * @param message TransferEntitlementsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TransferEntitlementsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferEntitlementsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferEntitlementsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferEntitlementsToGoogleRequest. */ + interface ITransferEntitlementsToGoogleRequest { + + /** TransferEntitlementsToGoogleRequest parent */ + parent?: (string|null); + + /** TransferEntitlementsToGoogleRequest entitlements */ + entitlements?: (google.cloud.channel.v1.IEntitlement[]|null); + + /** TransferEntitlementsToGoogleRequest requestId */ + requestId?: (string|null); + } + + /** Represents a TransferEntitlementsToGoogleRequest. */ + class TransferEntitlementsToGoogleRequest implements ITransferEntitlementsToGoogleRequest { + + /** + * Constructs a new TransferEntitlementsToGoogleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest); + + /** TransferEntitlementsToGoogleRequest parent. */ + public parent: string; + + /** TransferEntitlementsToGoogleRequest entitlements. */ + public entitlements: google.cloud.channel.v1.IEntitlement[]; + + /** TransferEntitlementsToGoogleRequest requestId. */ + public requestId: string; + + /** + * Creates a new TransferEntitlementsToGoogleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferEntitlementsToGoogleRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest): google.cloud.channel.v1.TransferEntitlementsToGoogleRequest; + + /** + * Encodes the specified TransferEntitlementsToGoogleRequest message. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsToGoogleRequest.verify|verify} messages. + * @param message TransferEntitlementsToGoogleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferEntitlementsToGoogleRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsToGoogleRequest.verify|verify} messages. + * @param message TransferEntitlementsToGoogleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferEntitlementsToGoogleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferEntitlementsToGoogleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.TransferEntitlementsToGoogleRequest; + + /** + * Decodes a TransferEntitlementsToGoogleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferEntitlementsToGoogleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.TransferEntitlementsToGoogleRequest; + + /** + * Verifies a TransferEntitlementsToGoogleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferEntitlementsToGoogleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferEntitlementsToGoogleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.TransferEntitlementsToGoogleRequest; + + /** + * Creates a plain object from a TransferEntitlementsToGoogleRequest message. Also converts values to other types if specified. + * @param message TransferEntitlementsToGoogleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.TransferEntitlementsToGoogleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferEntitlementsToGoogleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferEntitlementsToGoogleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeParametersRequest. */ + interface IChangeParametersRequest { + + /** ChangeParametersRequest name */ + name?: (string|null); + + /** ChangeParametersRequest parameters */ + parameters?: (google.cloud.channel.v1.IParameter[]|null); + + /** ChangeParametersRequest requestId */ + requestId?: (string|null); + + /** ChangeParametersRequest purchaseOrderId */ + purchaseOrderId?: (string|null); + } + + /** Represents a ChangeParametersRequest. */ + class ChangeParametersRequest implements IChangeParametersRequest { + + /** + * Constructs a new ChangeParametersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IChangeParametersRequest); + + /** ChangeParametersRequest name. */ + public name: string; + + /** ChangeParametersRequest parameters. */ + public parameters: google.cloud.channel.v1.IParameter[]; + + /** ChangeParametersRequest requestId. */ + public requestId: string; + + /** ChangeParametersRequest purchaseOrderId. */ + public purchaseOrderId: string; + + /** + * Creates a new ChangeParametersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeParametersRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IChangeParametersRequest): google.cloud.channel.v1.ChangeParametersRequest; + + /** + * Encodes the specified ChangeParametersRequest message. Does not implicitly {@link google.cloud.channel.v1.ChangeParametersRequest.verify|verify} messages. + * @param message ChangeParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IChangeParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeParametersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChangeParametersRequest.verify|verify} messages. + * @param message ChangeParametersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IChangeParametersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeParametersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ChangeParametersRequest; + + /** + * Decodes a ChangeParametersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ChangeParametersRequest; + + /** + * Verifies a ChangeParametersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeParametersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeParametersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ChangeParametersRequest; + + /** + * Creates a plain object from a ChangeParametersRequest message. Also converts values to other types if specified. + * @param message ChangeParametersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ChangeParametersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeParametersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeParametersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeRenewalSettingsRequest. */ + interface IChangeRenewalSettingsRequest { + + /** ChangeRenewalSettingsRequest name */ + name?: (string|null); + + /** ChangeRenewalSettingsRequest renewalSettings */ + renewalSettings?: (google.cloud.channel.v1.IRenewalSettings|null); + + /** ChangeRenewalSettingsRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ChangeRenewalSettingsRequest. */ + class ChangeRenewalSettingsRequest implements IChangeRenewalSettingsRequest { + + /** + * Constructs a new ChangeRenewalSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IChangeRenewalSettingsRequest); + + /** ChangeRenewalSettingsRequest name. */ + public name: string; + + /** ChangeRenewalSettingsRequest renewalSettings. */ + public renewalSettings?: (google.cloud.channel.v1.IRenewalSettings|null); + + /** ChangeRenewalSettingsRequest requestId. */ + public requestId: string; + + /** + * Creates a new ChangeRenewalSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeRenewalSettingsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IChangeRenewalSettingsRequest): google.cloud.channel.v1.ChangeRenewalSettingsRequest; + + /** + * Encodes the specified ChangeRenewalSettingsRequest message. Does not implicitly {@link google.cloud.channel.v1.ChangeRenewalSettingsRequest.verify|verify} messages. + * @param message ChangeRenewalSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IChangeRenewalSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeRenewalSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChangeRenewalSettingsRequest.verify|verify} messages. + * @param message ChangeRenewalSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IChangeRenewalSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeRenewalSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeRenewalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ChangeRenewalSettingsRequest; + + /** + * Decodes a ChangeRenewalSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeRenewalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ChangeRenewalSettingsRequest; + + /** + * Verifies a ChangeRenewalSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeRenewalSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeRenewalSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ChangeRenewalSettingsRequest; + + /** + * Creates a plain object from a ChangeRenewalSettingsRequest message. Also converts values to other types if specified. + * @param message ChangeRenewalSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ChangeRenewalSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeRenewalSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeRenewalSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeOfferRequest. */ + interface IChangeOfferRequest { + + /** ChangeOfferRequest name */ + name?: (string|null); + + /** ChangeOfferRequest offer */ + offer?: (string|null); + + /** ChangeOfferRequest parameters */ + parameters?: (google.cloud.channel.v1.IParameter[]|null); + + /** ChangeOfferRequest purchaseOrderId */ + purchaseOrderId?: (string|null); + + /** ChangeOfferRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ChangeOfferRequest. */ + class ChangeOfferRequest implements IChangeOfferRequest { + + /** + * Constructs a new ChangeOfferRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IChangeOfferRequest); + + /** ChangeOfferRequest name. */ + public name: string; + + /** ChangeOfferRequest offer. */ + public offer: string; + + /** ChangeOfferRequest parameters. */ + public parameters: google.cloud.channel.v1.IParameter[]; + + /** ChangeOfferRequest purchaseOrderId. */ + public purchaseOrderId: string; + + /** ChangeOfferRequest requestId. */ + public requestId: string; + + /** + * Creates a new ChangeOfferRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeOfferRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IChangeOfferRequest): google.cloud.channel.v1.ChangeOfferRequest; + + /** + * Encodes the specified ChangeOfferRequest message. Does not implicitly {@link google.cloud.channel.v1.ChangeOfferRequest.verify|verify} messages. + * @param message ChangeOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IChangeOfferRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeOfferRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChangeOfferRequest.verify|verify} messages. + * @param message ChangeOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IChangeOfferRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeOfferRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ChangeOfferRequest; + + /** + * Decodes a ChangeOfferRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ChangeOfferRequest; + + /** + * Verifies a ChangeOfferRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeOfferRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeOfferRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ChangeOfferRequest; + + /** + * Creates a plain object from a ChangeOfferRequest message. Also converts values to other types if specified. + * @param message ChangeOfferRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ChangeOfferRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeOfferRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeOfferRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartPaidServiceRequest. */ + interface IStartPaidServiceRequest { + + /** StartPaidServiceRequest name */ + name?: (string|null); + + /** StartPaidServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a StartPaidServiceRequest. */ + class StartPaidServiceRequest implements IStartPaidServiceRequest { + + /** + * Constructs a new StartPaidServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IStartPaidServiceRequest); + + /** StartPaidServiceRequest name. */ + public name: string; + + /** StartPaidServiceRequest requestId. */ + public requestId: string; + + /** + * Creates a new StartPaidServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartPaidServiceRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IStartPaidServiceRequest): google.cloud.channel.v1.StartPaidServiceRequest; + + /** + * Encodes the specified StartPaidServiceRequest message. Does not implicitly {@link google.cloud.channel.v1.StartPaidServiceRequest.verify|verify} messages. + * @param message StartPaidServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IStartPaidServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartPaidServiceRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.StartPaidServiceRequest.verify|verify} messages. + * @param message StartPaidServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IStartPaidServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartPaidServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartPaidServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.StartPaidServiceRequest; + + /** + * Decodes a StartPaidServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartPaidServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.StartPaidServiceRequest; + + /** + * Verifies a StartPaidServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartPaidServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartPaidServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.StartPaidServiceRequest; + + /** + * Creates a plain object from a StartPaidServiceRequest message. Also converts values to other types if specified. + * @param message StartPaidServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.StartPaidServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartPaidServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartPaidServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelEntitlementRequest. */ + interface ICancelEntitlementRequest { + + /** CancelEntitlementRequest name */ + name?: (string|null); + + /** CancelEntitlementRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CancelEntitlementRequest. */ + class CancelEntitlementRequest implements ICancelEntitlementRequest { + + /** + * Constructs a new CancelEntitlementRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICancelEntitlementRequest); + + /** CancelEntitlementRequest name. */ + public name: string; + + /** CancelEntitlementRequest requestId. */ + public requestId: string; + + /** + * Creates a new CancelEntitlementRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelEntitlementRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ICancelEntitlementRequest): google.cloud.channel.v1.CancelEntitlementRequest; + + /** + * Encodes the specified CancelEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.CancelEntitlementRequest.verify|verify} messages. + * @param message CancelEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICancelEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CancelEntitlementRequest.verify|verify} messages. + * @param message CancelEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICancelEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelEntitlementRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CancelEntitlementRequest; + + /** + * Decodes a CancelEntitlementRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CancelEntitlementRequest; + + /** + * Verifies a CancelEntitlementRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelEntitlementRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CancelEntitlementRequest; + + /** + * Creates a plain object from a CancelEntitlementRequest message. Also converts values to other types if specified. + * @param message CancelEntitlementRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CancelEntitlementRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelEntitlementRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelEntitlementRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SuspendEntitlementRequest. */ + interface ISuspendEntitlementRequest { + + /** SuspendEntitlementRequest name */ + name?: (string|null); + + /** SuspendEntitlementRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SuspendEntitlementRequest. */ + class SuspendEntitlementRequest implements ISuspendEntitlementRequest { + + /** + * Constructs a new SuspendEntitlementRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ISuspendEntitlementRequest); + + /** SuspendEntitlementRequest name. */ + public name: string; + + /** SuspendEntitlementRequest requestId. */ + public requestId: string; + + /** + * Creates a new SuspendEntitlementRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SuspendEntitlementRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ISuspendEntitlementRequest): google.cloud.channel.v1.SuspendEntitlementRequest; + + /** + * Encodes the specified SuspendEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.SuspendEntitlementRequest.verify|verify} messages. + * @param message SuspendEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ISuspendEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuspendEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SuspendEntitlementRequest.verify|verify} messages. + * @param message SuspendEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ISuspendEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuspendEntitlementRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuspendEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.SuspendEntitlementRequest; + + /** + * Decodes a SuspendEntitlementRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuspendEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.SuspendEntitlementRequest; + + /** + * Verifies a SuspendEntitlementRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuspendEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuspendEntitlementRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.SuspendEntitlementRequest; + + /** + * Creates a plain object from a SuspendEntitlementRequest message. Also converts values to other types if specified. + * @param message SuspendEntitlementRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.SuspendEntitlementRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuspendEntitlementRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SuspendEntitlementRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ActivateEntitlementRequest. */ + interface IActivateEntitlementRequest { + + /** ActivateEntitlementRequest name */ + name?: (string|null); + + /** ActivateEntitlementRequest requestId */ + requestId?: (string|null); + } + + /** Represents an ActivateEntitlementRequest. */ + class ActivateEntitlementRequest implements IActivateEntitlementRequest { + + /** + * Constructs a new ActivateEntitlementRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IActivateEntitlementRequest); + + /** ActivateEntitlementRequest name. */ + public name: string; + + /** ActivateEntitlementRequest requestId. */ + public requestId: string; + + /** + * Creates a new ActivateEntitlementRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ActivateEntitlementRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IActivateEntitlementRequest): google.cloud.channel.v1.ActivateEntitlementRequest; + + /** + * Encodes the specified ActivateEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.ActivateEntitlementRequest.verify|verify} messages. + * @param message ActivateEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IActivateEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActivateEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ActivateEntitlementRequest.verify|verify} messages. + * @param message ActivateEntitlementRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IActivateEntitlementRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActivateEntitlementRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActivateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ActivateEntitlementRequest; + + /** + * Decodes an ActivateEntitlementRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActivateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ActivateEntitlementRequest; + + /** + * Verifies an ActivateEntitlementRequest message. + * @param message Plain 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 ActivateEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActivateEntitlementRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ActivateEntitlementRequest; + + /** + * Creates a plain object from an ActivateEntitlementRequest message. Also converts values to other types if specified. + * @param message ActivateEntitlementRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ActivateEntitlementRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActivateEntitlementRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActivateEntitlementRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LookupOfferRequest. */ + interface ILookupOfferRequest { + + /** LookupOfferRequest entitlement */ + entitlement?: (string|null); + } + + /** Represents a LookupOfferRequest. */ + class LookupOfferRequest implements ILookupOfferRequest { + + /** + * Constructs a new LookupOfferRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ILookupOfferRequest); + + /** LookupOfferRequest entitlement. */ + public entitlement: string; + + /** + * Creates a new LookupOfferRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupOfferRequest instance + */ + public static create(properties?: google.cloud.channel.v1.ILookupOfferRequest): google.cloud.channel.v1.LookupOfferRequest; + + /** + * Encodes the specified LookupOfferRequest message. Does not implicitly {@link google.cloud.channel.v1.LookupOfferRequest.verify|verify} messages. + * @param message LookupOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ILookupOfferRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LookupOfferRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.LookupOfferRequest.verify|verify} messages. + * @param message LookupOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ILookupOfferRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LookupOfferRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.LookupOfferRequest; + + /** + * Decodes a LookupOfferRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.LookupOfferRequest; + + /** + * Verifies a LookupOfferRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LookupOfferRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupOfferRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.LookupOfferRequest; + + /** + * Creates a plain object from a LookupOfferRequest message. Also converts values to other types if specified. + * @param message LookupOfferRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.LookupOfferRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LookupOfferRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LookupOfferRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProductsRequest. */ + interface IListProductsRequest { + + /** ListProductsRequest account */ + account?: (string|null); + + /** ListProductsRequest pageSize */ + pageSize?: (number|null); + + /** ListProductsRequest pageToken */ + pageToken?: (string|null); + + /** ListProductsRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListProductsRequest. */ + class ListProductsRequest implements IListProductsRequest { + + /** + * Constructs a new ListProductsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListProductsRequest); + + /** ListProductsRequest account. */ + public account: string; + + /** ListProductsRequest pageSize. */ + public pageSize: number; + + /** ListProductsRequest pageToken. */ + public pageToken: string; + + /** ListProductsRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListProductsRequest): google.cloud.channel.v1.ListProductsRequest; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListProductsRequest.verify|verify} messages. + * @param message ListProductsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListProductsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListProductsRequest; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListProductsRequest; + + /** + * Verifies a ListProductsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListProductsRequest; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @param message ListProductsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListProductsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProductsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProductsResponse. */ + interface IListProductsResponse { + + /** ListProductsResponse products */ + products?: (google.cloud.channel.v1.IProduct[]|null); + + /** ListProductsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProductsResponse. */ + class ListProductsResponse implements IListProductsResponse { + + /** + * Constructs a new ListProductsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListProductsResponse); + + /** ListProductsResponse products. */ + public products: google.cloud.channel.v1.IProduct[]; + + /** ListProductsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProductsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListProductsResponse): google.cloud.channel.v1.ListProductsResponse; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListProductsResponse.verify|verify} messages. + * @param message ListProductsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListProductsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListProductsResponse; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListProductsResponse; + + /** + * Verifies a ListProductsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProductsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListProductsResponse; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @param message ListProductsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListProductsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProductsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProductsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSkusRequest. */ + interface IListSkusRequest { + + /** ListSkusRequest parent */ + parent?: (string|null); + + /** ListSkusRequest account */ + account?: (string|null); + + /** ListSkusRequest pageSize */ + pageSize?: (number|null); + + /** ListSkusRequest pageToken */ + pageToken?: (string|null); + + /** ListSkusRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListSkusRequest. */ + class ListSkusRequest implements IListSkusRequest { + + /** + * Constructs a new ListSkusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListSkusRequest); + + /** ListSkusRequest parent. */ + public parent: string; + + /** ListSkusRequest account. */ + public account: string; + + /** ListSkusRequest pageSize. */ + public pageSize: number; + + /** ListSkusRequest pageToken. */ + public pageToken: string; + + /** ListSkusRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListSkusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSkusRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListSkusRequest): google.cloud.channel.v1.ListSkusRequest; + + /** + * Encodes the specified ListSkusRequest message. Does not implicitly {@link google.cloud.channel.v1.ListSkusRequest.verify|verify} messages. + * @param message ListSkusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListSkusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSkusRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSkusRequest.verify|verify} messages. + * @param message ListSkusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListSkusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSkusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListSkusRequest; + + /** + * Decodes a ListSkusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListSkusRequest; + + /** + * Verifies a ListSkusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSkusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSkusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListSkusRequest; + + /** + * Creates a plain object from a ListSkusRequest message. Also converts values to other types if specified. + * @param message ListSkusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListSkusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSkusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSkusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSkusResponse. */ + interface IListSkusResponse { + + /** ListSkusResponse skus */ + skus?: (google.cloud.channel.v1.ISku[]|null); + + /** ListSkusResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSkusResponse. */ + class ListSkusResponse implements IListSkusResponse { + + /** + * Constructs a new ListSkusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListSkusResponse); + + /** ListSkusResponse skus. */ + public skus: google.cloud.channel.v1.ISku[]; + + /** ListSkusResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSkusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSkusResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListSkusResponse): google.cloud.channel.v1.ListSkusResponse; + + /** + * Encodes the specified ListSkusResponse message. Does not implicitly {@link google.cloud.channel.v1.ListSkusResponse.verify|verify} messages. + * @param message ListSkusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListSkusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSkusResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSkusResponse.verify|verify} messages. + * @param message ListSkusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListSkusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSkusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListSkusResponse; + + /** + * Decodes a ListSkusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListSkusResponse; + + /** + * Verifies a ListSkusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSkusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSkusResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListSkusResponse; + + /** + * Creates a plain object from a ListSkusResponse message. Also converts values to other types if specified. + * @param message ListSkusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListSkusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSkusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSkusResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOffersRequest. */ + interface IListOffersRequest { + + /** ListOffersRequest parent */ + parent?: (string|null); + + /** ListOffersRequest pageSize */ + pageSize?: (number|null); + + /** ListOffersRequest pageToken */ + pageToken?: (string|null); + + /** ListOffersRequest filter */ + filter?: (string|null); + + /** ListOffersRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListOffersRequest. */ + class ListOffersRequest implements IListOffersRequest { + + /** + * Constructs a new ListOffersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListOffersRequest); + + /** ListOffersRequest parent. */ + public parent: string; + + /** ListOffersRequest pageSize. */ + public pageSize: number; + + /** ListOffersRequest pageToken. */ + public pageToken: string; + + /** ListOffersRequest filter. */ + public filter: string; + + /** ListOffersRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new ListOffersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOffersRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListOffersRequest): google.cloud.channel.v1.ListOffersRequest; + + /** + * Encodes the specified ListOffersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListOffersRequest.verify|verify} messages. + * @param message ListOffersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListOffersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOffersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListOffersRequest.verify|verify} messages. + * @param message ListOffersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListOffersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOffersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListOffersRequest; + + /** + * Decodes a ListOffersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListOffersRequest; + + /** + * Verifies a ListOffersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOffersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOffersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListOffersRequest; + + /** + * Creates a plain object from a ListOffersRequest message. Also converts values to other types if specified. + * @param message ListOffersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListOffersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOffersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOffersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOffersResponse. */ + interface IListOffersResponse { + + /** ListOffersResponse offers */ + offers?: (google.cloud.channel.v1.IOffer[]|null); + + /** ListOffersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOffersResponse. */ + class ListOffersResponse implements IListOffersResponse { + + /** + * Constructs a new ListOffersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListOffersResponse); + + /** ListOffersResponse offers. */ + public offers: google.cloud.channel.v1.IOffer[]; + + /** ListOffersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOffersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOffersResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListOffersResponse): google.cloud.channel.v1.ListOffersResponse; + + /** + * Encodes the specified ListOffersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListOffersResponse.verify|verify} messages. + * @param message ListOffersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListOffersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOffersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListOffersResponse.verify|verify} messages. + * @param message ListOffersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListOffersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOffersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListOffersResponse; + + /** + * Decodes a ListOffersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListOffersResponse; + + /** + * Verifies a ListOffersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOffersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOffersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListOffersResponse; + + /** + * Creates a plain object from a ListOffersResponse message. Also converts values to other types if specified. + * @param message ListOffersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListOffersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOffersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOffersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPurchasableSkusRequest. */ + interface IListPurchasableSkusRequest { + + /** ListPurchasableSkusRequest createEntitlementPurchase */ + createEntitlementPurchase?: (google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase|null); + + /** ListPurchasableSkusRequest changeOfferPurchase */ + changeOfferPurchase?: (google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase|null); + + /** ListPurchasableSkusRequest customer */ + customer?: (string|null); + + /** ListPurchasableSkusRequest pageSize */ + pageSize?: (number|null); + + /** ListPurchasableSkusRequest pageToken */ + pageToken?: (string|null); + + /** ListPurchasableSkusRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListPurchasableSkusRequest. */ + class ListPurchasableSkusRequest implements IListPurchasableSkusRequest { + + /** + * Constructs a new ListPurchasableSkusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListPurchasableSkusRequest); + + /** ListPurchasableSkusRequest createEntitlementPurchase. */ + public createEntitlementPurchase?: (google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase|null); + + /** ListPurchasableSkusRequest changeOfferPurchase. */ + public changeOfferPurchase?: (google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase|null); + + /** ListPurchasableSkusRequest customer. */ + public customer: string; + + /** ListPurchasableSkusRequest pageSize. */ + public pageSize: number; + + /** ListPurchasableSkusRequest pageToken. */ + public pageToken: string; + + /** ListPurchasableSkusRequest languageCode. */ + public languageCode: string; + + /** ListPurchasableSkusRequest purchaseOption. */ + public purchaseOption?: ("createEntitlementPurchase"|"changeOfferPurchase"); + + /** + * Creates a new ListPurchasableSkusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPurchasableSkusRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListPurchasableSkusRequest): google.cloud.channel.v1.ListPurchasableSkusRequest; + + /** + * Encodes the specified ListPurchasableSkusRequest message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.verify|verify} messages. + * @param message ListPurchasableSkusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListPurchasableSkusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPurchasableSkusRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.verify|verify} messages. + * @param message ListPurchasableSkusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListPurchasableSkusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPurchasableSkusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPurchasableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableSkusRequest; + + /** + * Decodes a ListPurchasableSkusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPurchasableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableSkusRequest; + + /** + * Verifies a ListPurchasableSkusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPurchasableSkusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPurchasableSkusRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableSkusRequest; + + /** + * Creates a plain object from a ListPurchasableSkusRequest message. Also converts values to other types if specified. + * @param message ListPurchasableSkusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableSkusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPurchasableSkusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPurchasableSkusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListPurchasableSkusRequest { + + /** Properties of a CreateEntitlementPurchase. */ + interface ICreateEntitlementPurchase { + + /** CreateEntitlementPurchase product */ + product?: (string|null); + } + + /** Represents a CreateEntitlementPurchase. */ + class CreateEntitlementPurchase implements ICreateEntitlementPurchase { + + /** + * Constructs a new CreateEntitlementPurchase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase); + + /** CreateEntitlementPurchase product. */ + public product: string; + + /** + * Creates a new CreateEntitlementPurchase instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntitlementPurchase instance + */ + public static create(properties?: google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase): google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase; + + /** + * Encodes the specified CreateEntitlementPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.verify|verify} messages. + * @param message CreateEntitlementPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEntitlementPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.verify|verify} messages. + * @param message CreateEntitlementPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase; + + /** + * Verifies a CreateEntitlementPurchase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEntitlementPurchase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntitlementPurchase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase; + + /** + * Creates a plain object from a CreateEntitlementPurchase message. Also converts values to other types if specified. + * @param message CreateEntitlementPurchase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEntitlementPurchase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEntitlementPurchase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeOfferPurchase. */ + interface IChangeOfferPurchase { + + /** ChangeOfferPurchase entitlement */ + entitlement?: (string|null); + + /** ChangeOfferPurchase changeType */ + changeType?: (google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType|keyof typeof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType|null); + } + + /** Represents a ChangeOfferPurchase. */ + class ChangeOfferPurchase implements IChangeOfferPurchase { + + /** + * Constructs a new ChangeOfferPurchase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase); + + /** ChangeOfferPurchase entitlement. */ + public entitlement: string; + + /** ChangeOfferPurchase changeType. */ + public changeType: (google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType|keyof typeof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType); + + /** + * Creates a new ChangeOfferPurchase instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeOfferPurchase instance + */ + public static create(properties?: google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase): google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase; + + /** + * Encodes the specified ChangeOfferPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.verify|verify} messages. + * @param message ChangeOfferPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeOfferPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.verify|verify} messages. + * @param message ChangeOfferPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase; + + /** + * Verifies a ChangeOfferPurchase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeOfferPurchase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeOfferPurchase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase; + + /** + * Creates a plain object from a ChangeOfferPurchase message. Also converts values to other types if specified. + * @param message ChangeOfferPurchase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeOfferPurchase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeOfferPurchase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ChangeOfferPurchase { + + /** ChangeType enum. */ + enum ChangeType { + CHANGE_TYPE_UNSPECIFIED = 0, + UPGRADE = 1, + DOWNGRADE = 2 + } + } + } + + /** Properties of a ListPurchasableSkusResponse. */ + interface IListPurchasableSkusResponse { + + /** ListPurchasableSkusResponse purchasableSkus */ + purchasableSkus?: (google.cloud.channel.v1.IPurchasableSku[]|null); + + /** ListPurchasableSkusResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPurchasableSkusResponse. */ + class ListPurchasableSkusResponse implements IListPurchasableSkusResponse { + + /** + * Constructs a new ListPurchasableSkusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListPurchasableSkusResponse); + + /** ListPurchasableSkusResponse purchasableSkus. */ + public purchasableSkus: google.cloud.channel.v1.IPurchasableSku[]; + + /** ListPurchasableSkusResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPurchasableSkusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPurchasableSkusResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListPurchasableSkusResponse): google.cloud.channel.v1.ListPurchasableSkusResponse; + + /** + * Encodes the specified ListPurchasableSkusResponse message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusResponse.verify|verify} messages. + * @param message ListPurchasableSkusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListPurchasableSkusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPurchasableSkusResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusResponse.verify|verify} messages. + * @param message ListPurchasableSkusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListPurchasableSkusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPurchasableSkusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPurchasableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableSkusResponse; + + /** + * Decodes a ListPurchasableSkusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPurchasableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableSkusResponse; + + /** + * Verifies a ListPurchasableSkusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPurchasableSkusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPurchasableSkusResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableSkusResponse; + + /** + * Creates a plain object from a ListPurchasableSkusResponse message. Also converts values to other types if specified. + * @param message ListPurchasableSkusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableSkusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPurchasableSkusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPurchasableSkusResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurchasableSku. */ + interface IPurchasableSku { + + /** PurchasableSku sku */ + sku?: (google.cloud.channel.v1.ISku|null); + } + + /** Represents a PurchasableSku. */ + class PurchasableSku implements IPurchasableSku { + + /** + * Constructs a new PurchasableSku. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPurchasableSku); + + /** PurchasableSku sku. */ + public sku?: (google.cloud.channel.v1.ISku|null); + + /** + * Creates a new PurchasableSku instance using the specified properties. + * @param [properties] Properties to set + * @returns PurchasableSku instance + */ + public static create(properties?: google.cloud.channel.v1.IPurchasableSku): google.cloud.channel.v1.PurchasableSku; + + /** + * Encodes the specified PurchasableSku message. Does not implicitly {@link google.cloud.channel.v1.PurchasableSku.verify|verify} messages. + * @param message PurchasableSku message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPurchasableSku, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurchasableSku message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PurchasableSku.verify|verify} messages. + * @param message PurchasableSku message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPurchasableSku, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurchasableSku message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurchasableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.PurchasableSku; + + /** + * Decodes a PurchasableSku message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurchasableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.PurchasableSku; + + /** + * Verifies a PurchasableSku message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurchasableSku message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurchasableSku + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.PurchasableSku; + + /** + * Creates a plain object from a PurchasableSku message. Also converts values to other types if specified. + * @param message PurchasableSku + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.PurchasableSku, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurchasableSku to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurchasableSku + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPurchasableOffersRequest. */ + interface IListPurchasableOffersRequest { + + /** ListPurchasableOffersRequest createEntitlementPurchase */ + createEntitlementPurchase?: (google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase|null); + + /** ListPurchasableOffersRequest changeOfferPurchase */ + changeOfferPurchase?: (google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase|null); + + /** ListPurchasableOffersRequest customer */ + customer?: (string|null); + + /** ListPurchasableOffersRequest pageSize */ + pageSize?: (number|null); + + /** ListPurchasableOffersRequest pageToken */ + pageToken?: (string|null); + + /** ListPurchasableOffersRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a ListPurchasableOffersRequest. */ + class ListPurchasableOffersRequest implements IListPurchasableOffersRequest { + + /** + * Constructs a new ListPurchasableOffersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListPurchasableOffersRequest); + + /** ListPurchasableOffersRequest createEntitlementPurchase. */ + public createEntitlementPurchase?: (google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase|null); + + /** ListPurchasableOffersRequest changeOfferPurchase. */ + public changeOfferPurchase?: (google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase|null); + + /** ListPurchasableOffersRequest customer. */ + public customer: string; + + /** ListPurchasableOffersRequest pageSize. */ + public pageSize: number; + + /** ListPurchasableOffersRequest pageToken. */ + public pageToken: string; + + /** ListPurchasableOffersRequest languageCode. */ + public languageCode: string; + + /** ListPurchasableOffersRequest purchaseOption. */ + public purchaseOption?: ("createEntitlementPurchase"|"changeOfferPurchase"); + + /** + * Creates a new ListPurchasableOffersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPurchasableOffersRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListPurchasableOffersRequest): google.cloud.channel.v1.ListPurchasableOffersRequest; + + /** + * Encodes the specified ListPurchasableOffersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.verify|verify} messages. + * @param message ListPurchasableOffersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListPurchasableOffersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPurchasableOffersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.verify|verify} messages. + * @param message ListPurchasableOffersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListPurchasableOffersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPurchasableOffersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPurchasableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableOffersRequest; + + /** + * Decodes a ListPurchasableOffersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPurchasableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableOffersRequest; + + /** + * Verifies a ListPurchasableOffersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPurchasableOffersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPurchasableOffersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableOffersRequest; + + /** + * Creates a plain object from a ListPurchasableOffersRequest message. Also converts values to other types if specified. + * @param message ListPurchasableOffersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableOffersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPurchasableOffersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPurchasableOffersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListPurchasableOffersRequest { + + /** Properties of a CreateEntitlementPurchase. */ + interface ICreateEntitlementPurchase { + + /** CreateEntitlementPurchase sku */ + sku?: (string|null); + } + + /** Represents a CreateEntitlementPurchase. */ + class CreateEntitlementPurchase implements ICreateEntitlementPurchase { + + /** + * Constructs a new CreateEntitlementPurchase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase); + + /** CreateEntitlementPurchase sku. */ + public sku: string; + + /** + * Creates a new CreateEntitlementPurchase instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntitlementPurchase instance + */ + public static create(properties?: google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase): google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase; + + /** + * Encodes the specified CreateEntitlementPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.verify|verify} messages. + * @param message CreateEntitlementPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEntitlementPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.verify|verify} messages. + * @param message CreateEntitlementPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase; + + /** + * Verifies a CreateEntitlementPurchase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEntitlementPurchase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntitlementPurchase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase; + + /** + * Creates a plain object from a CreateEntitlementPurchase message. Also converts values to other types if specified. + * @param message CreateEntitlementPurchase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEntitlementPurchase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEntitlementPurchase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChangeOfferPurchase. */ + interface IChangeOfferPurchase { + + /** ChangeOfferPurchase entitlement */ + entitlement?: (string|null); + + /** ChangeOfferPurchase newSku */ + newSku?: (string|null); + } + + /** Represents a ChangeOfferPurchase. */ + class ChangeOfferPurchase implements IChangeOfferPurchase { + + /** + * Constructs a new ChangeOfferPurchase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase); + + /** ChangeOfferPurchase entitlement. */ + public entitlement: string; + + /** ChangeOfferPurchase newSku. */ + public newSku: string; + + /** + * Creates a new ChangeOfferPurchase instance using the specified properties. + * @param [properties] Properties to set + * @returns ChangeOfferPurchase instance + */ + public static create(properties?: google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase): google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase; + + /** + * Encodes the specified ChangeOfferPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.verify|verify} messages. + * @param message ChangeOfferPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChangeOfferPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.verify|verify} messages. + * @param message ChangeOfferPurchase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase; + + /** + * Verifies a ChangeOfferPurchase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChangeOfferPurchase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChangeOfferPurchase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase; + + /** + * Creates a plain object from a ChangeOfferPurchase message. Also converts values to other types if specified. + * @param message ChangeOfferPurchase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChangeOfferPurchase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChangeOfferPurchase + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListPurchasableOffersResponse. */ + interface IListPurchasableOffersResponse { + + /** ListPurchasableOffersResponse purchasableOffers */ + purchasableOffers?: (google.cloud.channel.v1.IPurchasableOffer[]|null); + + /** ListPurchasableOffersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPurchasableOffersResponse. */ + class ListPurchasableOffersResponse implements IListPurchasableOffersResponse { + + /** + * Constructs a new ListPurchasableOffersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListPurchasableOffersResponse); + + /** ListPurchasableOffersResponse purchasableOffers. */ + public purchasableOffers: google.cloud.channel.v1.IPurchasableOffer[]; + + /** ListPurchasableOffersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPurchasableOffersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPurchasableOffersResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListPurchasableOffersResponse): google.cloud.channel.v1.ListPurchasableOffersResponse; + + /** + * Encodes the specified ListPurchasableOffersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersResponse.verify|verify} messages. + * @param message ListPurchasableOffersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListPurchasableOffersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPurchasableOffersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersResponse.verify|verify} messages. + * @param message ListPurchasableOffersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListPurchasableOffersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPurchasableOffersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPurchasableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListPurchasableOffersResponse; + + /** + * Decodes a ListPurchasableOffersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPurchasableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListPurchasableOffersResponse; + + /** + * Verifies a ListPurchasableOffersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPurchasableOffersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPurchasableOffersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListPurchasableOffersResponse; + + /** + * Creates a plain object from a ListPurchasableOffersResponse message. Also converts values to other types if specified. + * @param message ListPurchasableOffersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListPurchasableOffersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPurchasableOffersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPurchasableOffersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PurchasableOffer. */ + interface IPurchasableOffer { + + /** PurchasableOffer offer */ + offer?: (google.cloud.channel.v1.IOffer|null); + } + + /** Represents a PurchasableOffer. */ + class PurchasableOffer implements IPurchasableOffer { + + /** + * Constructs a new PurchasableOffer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IPurchasableOffer); + + /** PurchasableOffer offer. */ + public offer?: (google.cloud.channel.v1.IOffer|null); + + /** + * Creates a new PurchasableOffer instance using the specified properties. + * @param [properties] Properties to set + * @returns PurchasableOffer instance + */ + public static create(properties?: google.cloud.channel.v1.IPurchasableOffer): google.cloud.channel.v1.PurchasableOffer; + + /** + * Encodes the specified PurchasableOffer message. Does not implicitly {@link google.cloud.channel.v1.PurchasableOffer.verify|verify} messages. + * @param message PurchasableOffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IPurchasableOffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PurchasableOffer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PurchasableOffer.verify|verify} messages. + * @param message PurchasableOffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IPurchasableOffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PurchasableOffer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PurchasableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.PurchasableOffer; + + /** + * Decodes a PurchasableOffer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PurchasableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.PurchasableOffer; + + /** + * Verifies a PurchasableOffer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PurchasableOffer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PurchasableOffer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.PurchasableOffer; + + /** + * Creates a plain object from a PurchasableOffer message. Also converts values to other types if specified. + * @param message PurchasableOffer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.PurchasableOffer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PurchasableOffer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PurchasableOffer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegisterSubscriberRequest. */ + interface IRegisterSubscriberRequest { + + /** RegisterSubscriberRequest account */ + account?: (string|null); + + /** RegisterSubscriberRequest serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a RegisterSubscriberRequest. */ + class RegisterSubscriberRequest implements IRegisterSubscriberRequest { + + /** + * Constructs a new RegisterSubscriberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRegisterSubscriberRequest); + + /** RegisterSubscriberRequest account. */ + public account: string; + + /** RegisterSubscriberRequest serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new RegisterSubscriberRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegisterSubscriberRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IRegisterSubscriberRequest): google.cloud.channel.v1.RegisterSubscriberRequest; + + /** + * Encodes the specified RegisterSubscriberRequest message. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberRequest.verify|verify} messages. + * @param message RegisterSubscriberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRegisterSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegisterSubscriberRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberRequest.verify|verify} messages. + * @param message RegisterSubscriberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRegisterSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegisterSubscriberRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RegisterSubscriberRequest; + + /** + * Decodes a RegisterSubscriberRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RegisterSubscriberRequest; + + /** + * Verifies a RegisterSubscriberRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegisterSubscriberRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegisterSubscriberRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RegisterSubscriberRequest; + + /** + * Creates a plain object from a RegisterSubscriberRequest message. Also converts values to other types if specified. + * @param message RegisterSubscriberRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RegisterSubscriberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegisterSubscriberRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegisterSubscriberRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegisterSubscriberResponse. */ + interface IRegisterSubscriberResponse { + + /** RegisterSubscriberResponse topic */ + topic?: (string|null); + } + + /** Represents a RegisterSubscriberResponse. */ + class RegisterSubscriberResponse implements IRegisterSubscriberResponse { + + /** + * Constructs a new RegisterSubscriberResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRegisterSubscriberResponse); + + /** RegisterSubscriberResponse topic. */ + public topic: string; + + /** + * Creates a new RegisterSubscriberResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RegisterSubscriberResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IRegisterSubscriberResponse): google.cloud.channel.v1.RegisterSubscriberResponse; + + /** + * Encodes the specified RegisterSubscriberResponse message. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberResponse.verify|verify} messages. + * @param message RegisterSubscriberResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRegisterSubscriberResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegisterSubscriberResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberResponse.verify|verify} messages. + * @param message RegisterSubscriberResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRegisterSubscriberResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegisterSubscriberResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.RegisterSubscriberResponse; + + /** + * Decodes a RegisterSubscriberResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.RegisterSubscriberResponse; + + /** + * Verifies a RegisterSubscriberResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegisterSubscriberResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegisterSubscriberResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RegisterSubscriberResponse; + + /** + * Creates a plain object from a RegisterSubscriberResponse message. Also converts values to other types if specified. + * @param message RegisterSubscriberResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RegisterSubscriberResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegisterSubscriberResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegisterSubscriberResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnregisterSubscriberRequest. */ + interface IUnregisterSubscriberRequest { + + /** UnregisterSubscriberRequest account */ + account?: (string|null); + + /** UnregisterSubscriberRequest serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents an UnregisterSubscriberRequest. */ + class UnregisterSubscriberRequest implements IUnregisterSubscriberRequest { + + /** + * Constructs a new UnregisterSubscriberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IUnregisterSubscriberRequest); + + /** UnregisterSubscriberRequest account. */ + public account: string; + + /** UnregisterSubscriberRequest serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new UnregisterSubscriberRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UnregisterSubscriberRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IUnregisterSubscriberRequest): google.cloud.channel.v1.UnregisterSubscriberRequest; + + /** + * Encodes the specified UnregisterSubscriberRequest message. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberRequest.verify|verify} messages. + * @param message UnregisterSubscriberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IUnregisterSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnregisterSubscriberRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberRequest.verify|verify} messages. + * @param message UnregisterSubscriberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IUnregisterSubscriberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnregisterSubscriberRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnregisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.UnregisterSubscriberRequest; + + /** + * Decodes an UnregisterSubscriberRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnregisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.UnregisterSubscriberRequest; + + /** + * Verifies an UnregisterSubscriberRequest message. + * @param message Plain 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 UnregisterSubscriberRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnregisterSubscriberRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.UnregisterSubscriberRequest; + + /** + * Creates a plain object from an UnregisterSubscriberRequest message. Also converts values to other types if specified. + * @param message UnregisterSubscriberRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.UnregisterSubscriberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnregisterSubscriberRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnregisterSubscriberRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnregisterSubscriberResponse. */ + interface IUnregisterSubscriberResponse { + + /** UnregisterSubscriberResponse topic */ + topic?: (string|null); + } + + /** Represents an UnregisterSubscriberResponse. */ + class UnregisterSubscriberResponse implements IUnregisterSubscriberResponse { + + /** + * Constructs a new UnregisterSubscriberResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IUnregisterSubscriberResponse); + + /** UnregisterSubscriberResponse topic. */ + public topic: string; + + /** + * Creates a new UnregisterSubscriberResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UnregisterSubscriberResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IUnregisterSubscriberResponse): google.cloud.channel.v1.UnregisterSubscriberResponse; + + /** + * Encodes the specified UnregisterSubscriberResponse message. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberResponse.verify|verify} messages. + * @param message UnregisterSubscriberResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IUnregisterSubscriberResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnregisterSubscriberResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberResponse.verify|verify} messages. + * @param message UnregisterSubscriberResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IUnregisterSubscriberResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnregisterSubscriberResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnregisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.UnregisterSubscriberResponse; + + /** + * Decodes an UnregisterSubscriberResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnregisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.UnregisterSubscriberResponse; + + /** + * Verifies an UnregisterSubscriberResponse message. + * @param message Plain 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 UnregisterSubscriberResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnregisterSubscriberResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.UnregisterSubscriberResponse; + + /** + * Creates a plain object from an UnregisterSubscriberResponse message. Also converts values to other types if specified. + * @param message UnregisterSubscriberResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.UnregisterSubscriberResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnregisterSubscriberResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnregisterSubscriberResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubscribersRequest. */ + interface IListSubscribersRequest { + + /** ListSubscribersRequest account */ + account?: (string|null); + + /** ListSubscribersRequest pageSize */ + pageSize?: (number|null); + + /** ListSubscribersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSubscribersRequest. */ + class ListSubscribersRequest implements IListSubscribersRequest { + + /** + * Constructs a new ListSubscribersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListSubscribersRequest); + + /** ListSubscribersRequest account. */ + public account: string; + + /** ListSubscribersRequest pageSize. */ + public pageSize: number; + + /** ListSubscribersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSubscribersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscribersRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IListSubscribersRequest): google.cloud.channel.v1.ListSubscribersRequest; + + /** + * Encodes the specified ListSubscribersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersRequest.verify|verify} messages. + * @param message ListSubscribersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListSubscribersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubscribersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersRequest.verify|verify} messages. + * @param message ListSubscribersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListSubscribersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubscribersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscribersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListSubscribersRequest; + + /** + * Decodes a ListSubscribersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscribersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListSubscribersRequest; + + /** + * Verifies a ListSubscribersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubscribersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscribersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListSubscribersRequest; + + /** + * Creates a plain object from a ListSubscribersRequest message. Also converts values to other types if specified. + * @param message ListSubscribersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListSubscribersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscribersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubscribersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubscribersResponse. */ + interface IListSubscribersResponse { + + /** ListSubscribersResponse topic */ + topic?: (string|null); + + /** ListSubscribersResponse serviceAccounts */ + serviceAccounts?: (string[]|null); + + /** ListSubscribersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSubscribersResponse. */ + class ListSubscribersResponse implements IListSubscribersResponse { + + /** + * Constructs a new ListSubscribersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IListSubscribersResponse); + + /** ListSubscribersResponse topic. */ + public topic: string; + + /** ListSubscribersResponse serviceAccounts. */ + public serviceAccounts: string[]; + + /** ListSubscribersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSubscribersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubscribersResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IListSubscribersResponse): google.cloud.channel.v1.ListSubscribersResponse; + + /** + * Encodes the specified ListSubscribersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersResponse.verify|verify} messages. + * @param message ListSubscribersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IListSubscribersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubscribersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersResponse.verify|verify} messages. + * @param message ListSubscribersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IListSubscribersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubscribersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.ListSubscribersResponse; + + /** + * Decodes a ListSubscribersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.ListSubscribersResponse; + + /** + * Verifies a ListSubscribersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubscribersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubscribersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ListSubscribersResponse; + + /** + * Creates a plain object from a ListSubscribersResponse message. Also converts values to other types if specified. + * @param message ListSubscribersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ListSubscribersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubscribersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubscribersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerEvent. */ + interface ICustomerEvent { + + /** CustomerEvent customer */ + customer?: (string|null); + + /** CustomerEvent eventType */ + eventType?: (google.cloud.channel.v1.CustomerEvent.Type|keyof typeof google.cloud.channel.v1.CustomerEvent.Type|null); + } + + /** Represents a CustomerEvent. */ + class CustomerEvent implements ICustomerEvent { + + /** + * Constructs a new CustomerEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ICustomerEvent); + + /** CustomerEvent customer. */ + public customer: string; + + /** CustomerEvent eventType. */ + public eventType: (google.cloud.channel.v1.CustomerEvent.Type|keyof typeof google.cloud.channel.v1.CustomerEvent.Type); + + /** + * Creates a new CustomerEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEvent instance + */ + public static create(properties?: google.cloud.channel.v1.ICustomerEvent): google.cloud.channel.v1.CustomerEvent; + + /** + * Encodes the specified CustomerEvent message. Does not implicitly {@link google.cloud.channel.v1.CustomerEvent.verify|verify} messages. + * @param message CustomerEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ICustomerEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEvent message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CustomerEvent.verify|verify} messages. + * @param message CustomerEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ICustomerEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.CustomerEvent; + + /** + * Decodes a CustomerEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.CustomerEvent; + + /** + * Verifies a CustomerEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.CustomerEvent; + + /** + * Creates a plain object from a CustomerEvent message. Also converts values to other types if specified. + * @param message CustomerEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.CustomerEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomerEvent { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + PRIMARY_DOMAIN_CHANGED = 1, + PRIMARY_DOMAIN_VERIFIED = 2 + } + } + + /** Properties of an EntitlementEvent. */ + interface IEntitlementEvent { + + /** EntitlementEvent entitlement */ + entitlement?: (string|null); + + /** EntitlementEvent eventType */ + eventType?: (google.cloud.channel.v1.EntitlementEvent.Type|keyof typeof google.cloud.channel.v1.EntitlementEvent.Type|null); + } + + /** Represents an EntitlementEvent. */ + class EntitlementEvent implements IEntitlementEvent { + + /** + * Constructs a new EntitlementEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IEntitlementEvent); + + /** EntitlementEvent entitlement. */ + public entitlement: string; + + /** EntitlementEvent eventType. */ + public eventType: (google.cloud.channel.v1.EntitlementEvent.Type|keyof typeof google.cloud.channel.v1.EntitlementEvent.Type); + + /** + * Creates a new EntitlementEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns EntitlementEvent instance + */ + public static create(properties?: google.cloud.channel.v1.IEntitlementEvent): google.cloud.channel.v1.EntitlementEvent; + + /** + * Encodes the specified EntitlementEvent message. Does not implicitly {@link google.cloud.channel.v1.EntitlementEvent.verify|verify} messages. + * @param message EntitlementEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IEntitlementEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntitlementEvent message, length delimited. Does not implicitly {@link google.cloud.channel.v1.EntitlementEvent.verify|verify} messages. + * @param message EntitlementEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IEntitlementEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntitlementEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntitlementEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.EntitlementEvent; + + /** + * Decodes an EntitlementEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntitlementEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.EntitlementEvent; + + /** + * Verifies an EntitlementEvent message. + * @param message Plain 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 EntitlementEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntitlementEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.EntitlementEvent; + + /** + * Creates a plain object from an EntitlementEvent message. Also converts values to other types if specified. + * @param message EntitlementEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.EntitlementEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntitlementEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntitlementEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntitlementEvent { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CREATED = 1, + PRICE_PLAN_SWITCHED = 3, + COMMITMENT_CHANGED = 4, + RENEWED = 5, + SUSPENDED = 6, + ACTIVATED = 7, + CANCELLED = 8, + SKU_CHANGED = 9, + RENEWAL_SETTING_CHANGED = 10, + PAID_SERVICE_STARTED = 11, + LICENSE_ASSIGNMENT_CHANGED = 12, + LICENSE_CAP_CHANGED = 13 + } + } + + /** Properties of a SubscriberEvent. */ + interface ISubscriberEvent { + + /** SubscriberEvent customerEvent */ + customerEvent?: (google.cloud.channel.v1.ICustomerEvent|null); + + /** SubscriberEvent entitlementEvent */ + entitlementEvent?: (google.cloud.channel.v1.IEntitlementEvent|null); + } + + /** Represents a SubscriberEvent. */ + class SubscriberEvent implements ISubscriberEvent { + + /** + * Constructs a new SubscriberEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ISubscriberEvent); + + /** SubscriberEvent customerEvent. */ + public customerEvent?: (google.cloud.channel.v1.ICustomerEvent|null); + + /** SubscriberEvent entitlementEvent. */ + public entitlementEvent?: (google.cloud.channel.v1.IEntitlementEvent|null); + + /** SubscriberEvent event. */ + public event?: ("customerEvent"|"entitlementEvent"); + + /** + * Creates a new SubscriberEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscriberEvent instance + */ + public static create(properties?: google.cloud.channel.v1.ISubscriberEvent): google.cloud.channel.v1.SubscriberEvent; + + /** + * Encodes the specified SubscriberEvent message. Does not implicitly {@link google.cloud.channel.v1.SubscriberEvent.verify|verify} messages. + * @param message SubscriberEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ISubscriberEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubscriberEvent message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SubscriberEvent.verify|verify} messages. + * @param message SubscriberEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ISubscriberEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubscriberEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscriberEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.channel.v1.SubscriberEvent; + + /** + * Decodes a SubscriberEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscriberEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.channel.v1.SubscriberEvent; + + /** + * Verifies a SubscriberEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubscriberEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscriberEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.SubscriberEvent; + + /** + * Creates a plain object from a SubscriberEvent message. Also converts values to other types if specified. + * @param message SubscriberEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.SubscriberEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubscriberEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscriberEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a PostalAddress. */ + interface IPostalAddress { + + /** PostalAddress revision */ + revision?: (number|null); + + /** PostalAddress regionCode */ + regionCode?: (string|null); + + /** PostalAddress languageCode */ + languageCode?: (string|null); + + /** PostalAddress postalCode */ + postalCode?: (string|null); + + /** PostalAddress sortingCode */ + sortingCode?: (string|null); + + /** PostalAddress administrativeArea */ + administrativeArea?: (string|null); + + /** PostalAddress locality */ + locality?: (string|null); + + /** PostalAddress sublocality */ + sublocality?: (string|null); + + /** PostalAddress addressLines */ + addressLines?: (string[]|null); + + /** PostalAddress recipients */ + recipients?: (string[]|null); + + /** PostalAddress organization */ + organization?: (string|null); + } + + /** Represents a PostalAddress. */ + class PostalAddress implements IPostalAddress { + + /** + * Constructs a new PostalAddress. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IPostalAddress); + + /** PostalAddress revision. */ + public revision: number; + + /** PostalAddress regionCode. */ + public regionCode: string; + + /** PostalAddress languageCode. */ + public languageCode: string; + + /** PostalAddress postalCode. */ + public postalCode: string; + + /** PostalAddress sortingCode. */ + public sortingCode: string; + + /** PostalAddress administrativeArea. */ + public administrativeArea: string; + + /** PostalAddress locality. */ + public locality: string; + + /** PostalAddress sublocality. */ + public sublocality: string; + + /** PostalAddress addressLines. */ + public addressLines: string[]; + + /** PostalAddress recipients. */ + public recipients: string[]; + + /** PostalAddress organization. */ + public organization: string; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns PostalAddress instance + */ + public static create(properties?: google.type.IPostalAddress): google.type.PostalAddress; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.PostalAddress; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.PostalAddress; + + /** + * Verifies a PostalAddress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostalAddress + */ + public static fromObject(object: { [k: string]: any }): google.type.PostalAddress; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @param message PostalAddress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.PostalAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostalAddress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostalAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Money. */ + interface IMoney { + + /** Money currencyCode */ + currencyCode?: (string|null); + + /** Money units */ + units?: (number|Long|string|null); + + /** Money nanos */ + nanos?: (number|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IMoney); + + /** Money currencyCode. */ + public currencyCode: string; + + /** Money units. */ + public units: (number|Long|string); + + /** Money nanos. */ + public nanos: number; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: google.type.IMoney): google.type.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Money; + + /** + * Verifies a Money message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): google.type.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Money + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTime. */ + interface IDateTime { + + /** DateTime year */ + year?: (number|null); + + /** DateTime month */ + month?: (number|null); + + /** DateTime day */ + day?: (number|null); + + /** DateTime hours */ + hours?: (number|null); + + /** DateTime minutes */ + minutes?: (number|null); + + /** DateTime seconds */ + seconds?: (number|null); + + /** DateTime nanos */ + nanos?: (number|null); + + /** DateTime utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone */ + timeZone?: (google.type.ITimeZone|null); + } + + /** Represents a DateTime. */ + class DateTime implements IDateTime { + + /** + * Constructs a new DateTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDateTime); + + /** DateTime year. */ + public year: number; + + /** DateTime month. */ + public month: number; + + /** DateTime day. */ + public day: number; + + /** DateTime hours. */ + public hours: number; + + /** DateTime minutes. */ + public minutes: number; + + /** DateTime seconds. */ + public seconds: number; + + /** DateTime nanos. */ + public nanos: number; + + /** DateTime utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** DateTime timeOffset. */ + public timeOffset?: ("utcOffset"|"timeZone"); + + /** + * Creates a new DateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTime instance + */ + public static create(properties?: google.type.IDateTime): google.type.DateTime; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.DateTime; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.DateTime; + + /** + * Verifies a DateTime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTime + */ + public static fromObject(object: { [k: string]: any }): google.type.DateTime; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @param message DateTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeZone. */ + interface ITimeZone { + + /** TimeZone id */ + id?: (string|null); + + /** TimeZone version */ + version?: (string|null); + } + + /** Represents a TimeZone. */ + class TimeZone implements ITimeZone { + + /** + * Constructs a new TimeZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeZone); + + /** TimeZone id. */ + public id: string; + + /** TimeZone version. */ + public version: string; + + /** + * Creates a new TimeZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZone instance + */ + public static create(properties?: google.type.ITimeZone): google.type.TimeZone; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeZone; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeZone; + + /** + * Verifies a TimeZone message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZone + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeZone; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @param message TimeZone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Decimal. */ + interface IDecimal { + + /** Decimal value */ + value?: (string|null); + } + + /** Represents a Decimal. */ + class Decimal implements IDecimal { + + /** + * Constructs a new Decimal. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDecimal); + + /** Decimal value. */ + public value: string; + + /** + * Creates a new Decimal instance using the specified properties. + * @param [properties] Properties to set + * @returns Decimal instance + */ + public static create(properties?: google.type.IDecimal): google.type.Decimal; + + /** + * Encodes the specified Decimal message. Does not implicitly {@link google.type.Decimal.verify|verify} messages. + * @param message Decimal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDecimal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Decimal message, length delimited. Does not implicitly {@link google.type.Decimal.verify|verify} messages. + * @param message Decimal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDecimal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Decimal message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Decimal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Decimal; + + /** + * Decodes a Decimal message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Decimal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Decimal; + + /** + * Verifies a Decimal message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Decimal message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Decimal + */ + public static fromObject(object: { [k: string]: any }): google.type.Decimal; + + /** + * Creates a plain object from a Decimal message. Also converts values to other types if specified. + * @param message Decimal + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Decimal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Decimal to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Decimal + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-channel/protos/protos.js b/packages/google-cloud-channel/protos/protos.js new file mode 100644 index 00000000000..11e2391eb56 --- /dev/null +++ b/packages/google-cloud-channel/protos/protos.js @@ -0,0 +1,52289 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_channel_protos || ($protobuf.roots._google_cloud_channel_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.channel = (function() { + + /** + * Namespace channel. + * @memberof google.cloud + * @namespace + */ + var channel = {}; + + channel.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.channel + * @namespace + */ + var v1 = {}; + + /** + * ChannelPartnerLinkView enum. + * @name google.cloud.channel.v1.ChannelPartnerLinkView + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.ChannelPartnerLinkView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + /** + * ChannelPartnerLinkState enum. + * @name google.cloud.channel.v1.ChannelPartnerLinkState + * @enum {number} + * @property {number} CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED=0 CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED value + * @property {number} INVITED=1 INVITED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} REVOKED=3 REVOKED value + * @property {number} SUSPENDED=4 SUSPENDED value + */ + v1.ChannelPartnerLinkState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVITED"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "REVOKED"] = 3; + values[valuesById[4] = "SUSPENDED"] = 4; + return values; + })(); + + v1.ChannelPartnerLink = (function() { + + /** + * Properties of a ChannelPartnerLink. + * @memberof google.cloud.channel.v1 + * @interface IChannelPartnerLink + * @property {string|null} [name] ChannelPartnerLink name + * @property {string|null} [resellerCloudIdentityId] ChannelPartnerLink resellerCloudIdentityId + * @property {google.cloud.channel.v1.ChannelPartnerLinkState|null} [linkState] ChannelPartnerLink linkState + * @property {string|null} [inviteLinkUri] ChannelPartnerLink inviteLinkUri + * @property {google.protobuf.ITimestamp|null} [createTime] ChannelPartnerLink createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ChannelPartnerLink updateTime + * @property {string|null} [publicId] ChannelPartnerLink publicId + * @property {google.cloud.channel.v1.ICloudIdentityInfo|null} [channelPartnerCloudIdentityInfo] ChannelPartnerLink channelPartnerCloudIdentityInfo + */ + + /** + * Constructs a new ChannelPartnerLink. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ChannelPartnerLink. + * @implements IChannelPartnerLink + * @constructor + * @param {google.cloud.channel.v1.IChannelPartnerLink=} [properties] Properties to set + */ + function ChannelPartnerLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelPartnerLink name. + * @member {string} name + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.name = ""; + + /** + * ChannelPartnerLink resellerCloudIdentityId. + * @member {string} resellerCloudIdentityId + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.resellerCloudIdentityId = ""; + + /** + * ChannelPartnerLink linkState. + * @member {google.cloud.channel.v1.ChannelPartnerLinkState} linkState + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.linkState = 0; + + /** + * ChannelPartnerLink inviteLinkUri. + * @member {string} inviteLinkUri + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.inviteLinkUri = ""; + + /** + * ChannelPartnerLink createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.createTime = null; + + /** + * ChannelPartnerLink updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.updateTime = null; + + /** + * ChannelPartnerLink publicId. + * @member {string} publicId + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.publicId = ""; + + /** + * ChannelPartnerLink channelPartnerCloudIdentityInfo. + * @member {google.cloud.channel.v1.ICloudIdentityInfo|null|undefined} channelPartnerCloudIdentityInfo + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + */ + ChannelPartnerLink.prototype.channelPartnerCloudIdentityInfo = null; + + /** + * Creates a new ChannelPartnerLink instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {google.cloud.channel.v1.IChannelPartnerLink=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ChannelPartnerLink} ChannelPartnerLink instance + */ + ChannelPartnerLink.create = function create(properties) { + return new ChannelPartnerLink(properties); + }; + + /** + * Encodes the specified ChannelPartnerLink message. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerLink.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {google.cloud.channel.v1.IChannelPartnerLink} message ChannelPartnerLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelPartnerLink.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.resellerCloudIdentityId != null && Object.hasOwnProperty.call(message, "resellerCloudIdentityId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resellerCloudIdentityId); + if (message.linkState != null && Object.hasOwnProperty.call(message, "linkState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.linkState); + if (message.inviteLinkUri != null && Object.hasOwnProperty.call(message, "inviteLinkUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.inviteLinkUri); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.publicId != null && Object.hasOwnProperty.call(message, "publicId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.publicId); + if (message.channelPartnerCloudIdentityInfo != null && Object.hasOwnProperty.call(message, "channelPartnerCloudIdentityInfo")) + $root.google.cloud.channel.v1.CloudIdentityInfo.encode(message.channelPartnerCloudIdentityInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChannelPartnerLink message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {google.cloud.channel.v1.IChannelPartnerLink} message ChannelPartnerLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelPartnerLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelPartnerLink message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ChannelPartnerLink} ChannelPartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelPartnerLink.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ChannelPartnerLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resellerCloudIdentityId = reader.string(); + break; + } + case 3: { + message.linkState = reader.int32(); + break; + } + case 4: { + message.inviteLinkUri = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.publicId = reader.string(); + break; + } + case 8: { + message.channelPartnerCloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelPartnerLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ChannelPartnerLink} ChannelPartnerLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelPartnerLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelPartnerLink message. + * @function verify + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelPartnerLink.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.resellerCloudIdentityId != null && message.hasOwnProperty("resellerCloudIdentityId")) + if (!$util.isString(message.resellerCloudIdentityId)) + return "resellerCloudIdentityId: string expected"; + if (message.linkState != null && message.hasOwnProperty("linkState")) + switch (message.linkState) { + default: + return "linkState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.inviteLinkUri != null && message.hasOwnProperty("inviteLinkUri")) + if (!$util.isString(message.inviteLinkUri)) + return "inviteLinkUri: 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.publicId != null && message.hasOwnProperty("publicId")) + if (!$util.isString(message.publicId)) + return "publicId: string expected"; + if (message.channelPartnerCloudIdentityInfo != null && message.hasOwnProperty("channelPartnerCloudIdentityInfo")) { + var error = $root.google.cloud.channel.v1.CloudIdentityInfo.verify(message.channelPartnerCloudIdentityInfo); + if (error) + return "channelPartnerCloudIdentityInfo." + error; + } + return null; + }; + + /** + * Creates a ChannelPartnerLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ChannelPartnerLink} ChannelPartnerLink + */ + ChannelPartnerLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ChannelPartnerLink) + return object; + var message = new $root.google.cloud.channel.v1.ChannelPartnerLink(); + if (object.name != null) + message.name = String(object.name); + if (object.resellerCloudIdentityId != null) + message.resellerCloudIdentityId = String(object.resellerCloudIdentityId); + switch (object.linkState) { + default: + if (typeof object.linkState === "number") { + message.linkState = object.linkState; + break; + } + break; + case "CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED": + case 0: + message.linkState = 0; + break; + case "INVITED": + case 1: + message.linkState = 1; + break; + case "ACTIVE": + case 2: + message.linkState = 2; + break; + case "REVOKED": + case 3: + message.linkState = 3; + break; + case "SUSPENDED": + case 4: + message.linkState = 4; + break; + } + if (object.inviteLinkUri != null) + message.inviteLinkUri = String(object.inviteLinkUri); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.channel.v1.ChannelPartnerLink.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.channel.v1.ChannelPartnerLink.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.publicId != null) + message.publicId = String(object.publicId); + if (object.channelPartnerCloudIdentityInfo != null) { + if (typeof object.channelPartnerCloudIdentityInfo !== "object") + throw TypeError(".google.cloud.channel.v1.ChannelPartnerLink.channelPartnerCloudIdentityInfo: object expected"); + message.channelPartnerCloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.fromObject(object.channelPartnerCloudIdentityInfo); + } + return message; + }; + + /** + * Creates a plain object from a ChannelPartnerLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {google.cloud.channel.v1.ChannelPartnerLink} message ChannelPartnerLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelPartnerLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.resellerCloudIdentityId = ""; + object.linkState = options.enums === String ? "CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED" : 0; + object.inviteLinkUri = ""; + object.createTime = null; + object.updateTime = null; + object.publicId = ""; + object.channelPartnerCloudIdentityInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resellerCloudIdentityId != null && message.hasOwnProperty("resellerCloudIdentityId")) + object.resellerCloudIdentityId = message.resellerCloudIdentityId; + if (message.linkState != null && message.hasOwnProperty("linkState")) + object.linkState = options.enums === String ? $root.google.cloud.channel.v1.ChannelPartnerLinkState[message.linkState] === undefined ? message.linkState : $root.google.cloud.channel.v1.ChannelPartnerLinkState[message.linkState] : message.linkState; + if (message.inviteLinkUri != null && message.hasOwnProperty("inviteLinkUri")) + object.inviteLinkUri = message.inviteLinkUri; + 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.publicId != null && message.hasOwnProperty("publicId")) + object.publicId = message.publicId; + if (message.channelPartnerCloudIdentityInfo != null && message.hasOwnProperty("channelPartnerCloudIdentityInfo")) + object.channelPartnerCloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.toObject(message.channelPartnerCloudIdentityInfo, options); + return object; + }; + + /** + * Converts this ChannelPartnerLink to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @instance + * @returns {Object.} JSON object + */ + ChannelPartnerLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelPartnerLink + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ChannelPartnerLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelPartnerLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ChannelPartnerLink"; + }; + + return ChannelPartnerLink; + })(); + + v1.EduData = (function() { + + /** + * Properties of an EduData. + * @memberof google.cloud.channel.v1 + * @interface IEduData + * @property {google.cloud.channel.v1.EduData.InstituteType|null} [instituteType] EduData instituteType + * @property {google.cloud.channel.v1.EduData.InstituteSize|null} [instituteSize] EduData instituteSize + * @property {string|null} [website] EduData website + */ + + /** + * Constructs a new EduData. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an EduData. + * @implements IEduData + * @constructor + * @param {google.cloud.channel.v1.IEduData=} [properties] Properties to set + */ + function EduData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EduData instituteType. + * @member {google.cloud.channel.v1.EduData.InstituteType} instituteType + * @memberof google.cloud.channel.v1.EduData + * @instance + */ + EduData.prototype.instituteType = 0; + + /** + * EduData instituteSize. + * @member {google.cloud.channel.v1.EduData.InstituteSize} instituteSize + * @memberof google.cloud.channel.v1.EduData + * @instance + */ + EduData.prototype.instituteSize = 0; + + /** + * EduData website. + * @member {string} website + * @memberof google.cloud.channel.v1.EduData + * @instance + */ + EduData.prototype.website = ""; + + /** + * Creates a new EduData instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {google.cloud.channel.v1.IEduData=} [properties] Properties to set + * @returns {google.cloud.channel.v1.EduData} EduData instance + */ + EduData.create = function create(properties) { + return new EduData(properties); + }; + + /** + * Encodes the specified EduData message. Does not implicitly {@link google.cloud.channel.v1.EduData.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {google.cloud.channel.v1.IEduData} message EduData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EduData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instituteType != null && Object.hasOwnProperty.call(message, "instituteType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.instituteType); + if (message.instituteSize != null && Object.hasOwnProperty.call(message, "instituteSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.instituteSize); + if (message.website != null && Object.hasOwnProperty.call(message, "website")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.website); + return writer; + }; + + /** + * Encodes the specified EduData message, length delimited. Does not implicitly {@link google.cloud.channel.v1.EduData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {google.cloud.channel.v1.IEduData} message EduData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EduData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EduData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.EduData} EduData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EduData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.EduData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instituteType = reader.int32(); + break; + } + case 2: { + message.instituteSize = reader.int32(); + break; + } + case 3: { + message.website = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EduData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.EduData} EduData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EduData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EduData message. + * @function verify + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EduData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instituteType != null && message.hasOwnProperty("instituteType")) + switch (message.instituteType) { + default: + return "instituteType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.instituteSize != null && message.hasOwnProperty("instituteSize")) + switch (message.instituteSize) { + default: + return "instituteSize: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.website != null && message.hasOwnProperty("website")) + if (!$util.isString(message.website)) + return "website: string expected"; + return null; + }; + + /** + * Creates an EduData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.EduData} EduData + */ + EduData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.EduData) + return object; + var message = new $root.google.cloud.channel.v1.EduData(); + switch (object.instituteType) { + default: + if (typeof object.instituteType === "number") { + message.instituteType = object.instituteType; + break; + } + break; + case "INSTITUTE_TYPE_UNSPECIFIED": + case 0: + message.instituteType = 0; + break; + case "K12": + case 1: + message.instituteType = 1; + break; + case "UNIVERSITY": + case 2: + message.instituteType = 2; + break; + } + switch (object.instituteSize) { + default: + if (typeof object.instituteSize === "number") { + message.instituteSize = object.instituteSize; + break; + } + break; + case "INSTITUTE_SIZE_UNSPECIFIED": + case 0: + message.instituteSize = 0; + break; + case "SIZE_1_100": + case 1: + message.instituteSize = 1; + break; + case "SIZE_101_500": + case 2: + message.instituteSize = 2; + break; + case "SIZE_501_1000": + case 3: + message.instituteSize = 3; + break; + case "SIZE_1001_2000": + case 4: + message.instituteSize = 4; + break; + case "SIZE_2001_5000": + case 5: + message.instituteSize = 5; + break; + case "SIZE_5001_10000": + case 6: + message.instituteSize = 6; + break; + case "SIZE_10001_OR_MORE": + case 7: + message.instituteSize = 7; + break; + } + if (object.website != null) + message.website = String(object.website); + return message; + }; + + /** + * Creates a plain object from an EduData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {google.cloud.channel.v1.EduData} message EduData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EduData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instituteType = options.enums === String ? "INSTITUTE_TYPE_UNSPECIFIED" : 0; + object.instituteSize = options.enums === String ? "INSTITUTE_SIZE_UNSPECIFIED" : 0; + object.website = ""; + } + if (message.instituteType != null && message.hasOwnProperty("instituteType")) + object.instituteType = options.enums === String ? $root.google.cloud.channel.v1.EduData.InstituteType[message.instituteType] === undefined ? message.instituteType : $root.google.cloud.channel.v1.EduData.InstituteType[message.instituteType] : message.instituteType; + if (message.instituteSize != null && message.hasOwnProperty("instituteSize")) + object.instituteSize = options.enums === String ? $root.google.cloud.channel.v1.EduData.InstituteSize[message.instituteSize] === undefined ? message.instituteSize : $root.google.cloud.channel.v1.EduData.InstituteSize[message.instituteSize] : message.instituteSize; + if (message.website != null && message.hasOwnProperty("website")) + object.website = message.website; + return object; + }; + + /** + * Converts this EduData to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.EduData + * @instance + * @returns {Object.} JSON object + */ + EduData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EduData + * @function getTypeUrl + * @memberof google.cloud.channel.v1.EduData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EduData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.EduData"; + }; + + /** + * InstituteType enum. + * @name google.cloud.channel.v1.EduData.InstituteType + * @enum {number} + * @property {number} INSTITUTE_TYPE_UNSPECIFIED=0 INSTITUTE_TYPE_UNSPECIFIED value + * @property {number} K12=1 K12 value + * @property {number} UNIVERSITY=2 UNIVERSITY value + */ + EduData.InstituteType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTITUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "K12"] = 1; + values[valuesById[2] = "UNIVERSITY"] = 2; + return values; + })(); + + /** + * InstituteSize enum. + * @name google.cloud.channel.v1.EduData.InstituteSize + * @enum {number} + * @property {number} INSTITUTE_SIZE_UNSPECIFIED=0 INSTITUTE_SIZE_UNSPECIFIED value + * @property {number} SIZE_1_100=1 SIZE_1_100 value + * @property {number} SIZE_101_500=2 SIZE_101_500 value + * @property {number} SIZE_501_1000=3 SIZE_501_1000 value + * @property {number} SIZE_1001_2000=4 SIZE_1001_2000 value + * @property {number} SIZE_2001_5000=5 SIZE_2001_5000 value + * @property {number} SIZE_5001_10000=6 SIZE_5001_10000 value + * @property {number} SIZE_10001_OR_MORE=7 SIZE_10001_OR_MORE value + */ + EduData.InstituteSize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTITUTE_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIZE_1_100"] = 1; + values[valuesById[2] = "SIZE_101_500"] = 2; + values[valuesById[3] = "SIZE_501_1000"] = 3; + values[valuesById[4] = "SIZE_1001_2000"] = 4; + values[valuesById[5] = "SIZE_2001_5000"] = 5; + values[valuesById[6] = "SIZE_5001_10000"] = 6; + values[valuesById[7] = "SIZE_10001_OR_MORE"] = 7; + return values; + })(); + + return EduData; + })(); + + v1.CloudIdentityInfo = (function() { + + /** + * Properties of a CloudIdentityInfo. + * @memberof google.cloud.channel.v1 + * @interface ICloudIdentityInfo + * @property {google.cloud.channel.v1.CloudIdentityInfo.CustomerType|null} [customerType] CloudIdentityInfo customerType + * @property {string|null} [primaryDomain] CloudIdentityInfo primaryDomain + * @property {boolean|null} [isDomainVerified] CloudIdentityInfo isDomainVerified + * @property {string|null} [alternateEmail] CloudIdentityInfo alternateEmail + * @property {string|null} [phoneNumber] CloudIdentityInfo phoneNumber + * @property {string|null} [languageCode] CloudIdentityInfo languageCode + * @property {string|null} [adminConsoleUri] CloudIdentityInfo adminConsoleUri + * @property {google.cloud.channel.v1.IEduData|null} [eduData] CloudIdentityInfo eduData + */ + + /** + * Constructs a new CloudIdentityInfo. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CloudIdentityInfo. + * @implements ICloudIdentityInfo + * @constructor + * @param {google.cloud.channel.v1.ICloudIdentityInfo=} [properties] Properties to set + */ + function CloudIdentityInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudIdentityInfo customerType. + * @member {google.cloud.channel.v1.CloudIdentityInfo.CustomerType} customerType + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.customerType = 0; + + /** + * CloudIdentityInfo primaryDomain. + * @member {string} primaryDomain + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.primaryDomain = ""; + + /** + * CloudIdentityInfo isDomainVerified. + * @member {boolean} isDomainVerified + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.isDomainVerified = false; + + /** + * CloudIdentityInfo alternateEmail. + * @member {string} alternateEmail + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.alternateEmail = ""; + + /** + * CloudIdentityInfo phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.phoneNumber = ""; + + /** + * CloudIdentityInfo languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.languageCode = ""; + + /** + * CloudIdentityInfo adminConsoleUri. + * @member {string} adminConsoleUri + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.adminConsoleUri = ""; + + /** + * CloudIdentityInfo eduData. + * @member {google.cloud.channel.v1.IEduData|null|undefined} eduData + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + */ + CloudIdentityInfo.prototype.eduData = null; + + /** + * Creates a new CloudIdentityInfo instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {google.cloud.channel.v1.ICloudIdentityInfo=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CloudIdentityInfo} CloudIdentityInfo instance + */ + CloudIdentityInfo.create = function create(properties) { + return new CloudIdentityInfo(properties); + }; + + /** + * Encodes the specified CloudIdentityInfo message. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {google.cloud.channel.v1.ICloudIdentityInfo} message CloudIdentityInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudIdentityInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerType != null && Object.hasOwnProperty.call(message, "customerType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customerType); + if (message.isDomainVerified != null && Object.hasOwnProperty.call(message, "isDomainVerified")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isDomainVerified); + if (message.alternateEmail != null && Object.hasOwnProperty.call(message, "alternateEmail")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.alternateEmail); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.phoneNumber); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.languageCode); + if (message.primaryDomain != null && Object.hasOwnProperty.call(message, "primaryDomain")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.primaryDomain); + if (message.adminConsoleUri != null && Object.hasOwnProperty.call(message, "adminConsoleUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.adminConsoleUri); + if (message.eduData != null && Object.hasOwnProperty.call(message, "eduData")) + $root.google.cloud.channel.v1.EduData.encode(message.eduData, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudIdentityInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {google.cloud.channel.v1.ICloudIdentityInfo} message CloudIdentityInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudIdentityInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudIdentityInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CloudIdentityInfo} CloudIdentityInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudIdentityInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CloudIdentityInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customerType = reader.int32(); + break; + } + case 9: { + message.primaryDomain = reader.string(); + break; + } + case 4: { + message.isDomainVerified = reader.bool(); + break; + } + case 6: { + message.alternateEmail = reader.string(); + break; + } + case 7: { + message.phoneNumber = reader.string(); + break; + } + case 8: { + message.languageCode = reader.string(); + break; + } + case 10: { + message.adminConsoleUri = reader.string(); + break; + } + case 22: { + message.eduData = $root.google.cloud.channel.v1.EduData.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudIdentityInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CloudIdentityInfo} CloudIdentityInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudIdentityInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudIdentityInfo message. + * @function verify + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudIdentityInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customerType != null && message.hasOwnProperty("customerType")) + switch (message.customerType) { + default: + return "customerType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.primaryDomain != null && message.hasOwnProperty("primaryDomain")) + if (!$util.isString(message.primaryDomain)) + return "primaryDomain: string expected"; + if (message.isDomainVerified != null && message.hasOwnProperty("isDomainVerified")) + if (typeof message.isDomainVerified !== "boolean") + return "isDomainVerified: boolean expected"; + if (message.alternateEmail != null && message.hasOwnProperty("alternateEmail")) + if (!$util.isString(message.alternateEmail)) + return "alternateEmail: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.adminConsoleUri != null && message.hasOwnProperty("adminConsoleUri")) + if (!$util.isString(message.adminConsoleUri)) + return "adminConsoleUri: string expected"; + if (message.eduData != null && message.hasOwnProperty("eduData")) { + var error = $root.google.cloud.channel.v1.EduData.verify(message.eduData); + if (error) + return "eduData." + error; + } + return null; + }; + + /** + * Creates a CloudIdentityInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CloudIdentityInfo} CloudIdentityInfo + */ + CloudIdentityInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CloudIdentityInfo) + return object; + var message = new $root.google.cloud.channel.v1.CloudIdentityInfo(); + switch (object.customerType) { + default: + if (typeof object.customerType === "number") { + message.customerType = object.customerType; + break; + } + break; + case "CUSTOMER_TYPE_UNSPECIFIED": + case 0: + message.customerType = 0; + break; + case "DOMAIN": + case 1: + message.customerType = 1; + break; + case "TEAM": + case 2: + message.customerType = 2; + break; + } + if (object.primaryDomain != null) + message.primaryDomain = String(object.primaryDomain); + if (object.isDomainVerified != null) + message.isDomainVerified = Boolean(object.isDomainVerified); + if (object.alternateEmail != null) + message.alternateEmail = String(object.alternateEmail); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.adminConsoleUri != null) + message.adminConsoleUri = String(object.adminConsoleUri); + if (object.eduData != null) { + if (typeof object.eduData !== "object") + throw TypeError(".google.cloud.channel.v1.CloudIdentityInfo.eduData: object expected"); + message.eduData = $root.google.cloud.channel.v1.EduData.fromObject(object.eduData); + } + return message; + }; + + /** + * Creates a plain object from a CloudIdentityInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {google.cloud.channel.v1.CloudIdentityInfo} message CloudIdentityInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudIdentityInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customerType = options.enums === String ? "CUSTOMER_TYPE_UNSPECIFIED" : 0; + object.isDomainVerified = false; + object.alternateEmail = ""; + object.phoneNumber = ""; + object.languageCode = ""; + object.primaryDomain = ""; + object.adminConsoleUri = ""; + object.eduData = null; + } + if (message.customerType != null && message.hasOwnProperty("customerType")) + object.customerType = options.enums === String ? $root.google.cloud.channel.v1.CloudIdentityInfo.CustomerType[message.customerType] === undefined ? message.customerType : $root.google.cloud.channel.v1.CloudIdentityInfo.CustomerType[message.customerType] : message.customerType; + if (message.isDomainVerified != null && message.hasOwnProperty("isDomainVerified")) + object.isDomainVerified = message.isDomainVerified; + if (message.alternateEmail != null && message.hasOwnProperty("alternateEmail")) + object.alternateEmail = message.alternateEmail; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.primaryDomain != null && message.hasOwnProperty("primaryDomain")) + object.primaryDomain = message.primaryDomain; + if (message.adminConsoleUri != null && message.hasOwnProperty("adminConsoleUri")) + object.adminConsoleUri = message.adminConsoleUri; + if (message.eduData != null && message.hasOwnProperty("eduData")) + object.eduData = $root.google.cloud.channel.v1.EduData.toObject(message.eduData, options); + return object; + }; + + /** + * Converts this CloudIdentityInfo to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @instance + * @returns {Object.} JSON object + */ + CloudIdentityInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudIdentityInfo + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CloudIdentityInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudIdentityInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CloudIdentityInfo"; + }; + + /** + * CustomerType enum. + * @name google.cloud.channel.v1.CloudIdentityInfo.CustomerType + * @enum {number} + * @property {number} CUSTOMER_TYPE_UNSPECIFIED=0 CUSTOMER_TYPE_UNSPECIFIED value + * @property {number} DOMAIN=1 DOMAIN value + * @property {number} TEAM=2 TEAM value + */ + CloudIdentityInfo.CustomerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CUSTOMER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOMAIN"] = 1; + values[valuesById[2] = "TEAM"] = 2; + return values; + })(); + + return CloudIdentityInfo; + })(); + + v1.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.cloud.channel.v1 + * @interface IValue + * @property {number|Long|null} [int64Value] Value int64Value + * @property {string|null} [stringValue] Value stringValue + * @property {number|null} [doubleValue] Value doubleValue + * @property {google.protobuf.IAny|null} [protoValue] Value protoValue + * @property {boolean|null} [boolValue] Value boolValue + */ + + /** + * Constructs a new Value. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.cloud.channel.v1.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value int64Value. + * @member {number|Long|null|undefined} int64Value + * @memberof google.cloud.channel.v1.Value + * @instance + */ + Value.prototype.int64Value = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.channel.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.cloud.channel.v1.Value + * @instance + */ + Value.prototype.doubleValue = null; + + /** + * Value protoValue. + * @member {google.protobuf.IAny|null|undefined} protoValue + * @memberof google.cloud.channel.v1.Value + * @instance + */ + Value.prototype.protoValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.cloud.channel.v1.Value + * @instance + */ + Value.prototype.boolValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"int64Value"|"stringValue"|"doubleValue"|"protoValue"|"boolValue"|undefined} kind + * @memberof google.cloud.channel.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["int64Value", "stringValue", "doubleValue", "protoValue", "boolValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Value + * @static + * @param {google.cloud.channel.v1.IValue=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.cloud.channel.v1.Value.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Value + * @static + * @param {google.cloud.channel.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.int64Value != null && Object.hasOwnProperty.call(message, "int64Value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.int64Value); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); + if (message.protoValue != null && Object.hasOwnProperty.call(message, "protoValue")) + $root.google.protobuf.Any.encode(message.protoValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.boolValue); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Value + * @static + * @param {google.cloud.channel.v1.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.int64Value = reader.int64(); + break; + } + case 2: { + message.stringValue = reader.string(); + break; + } + case 3: { + message.doubleValue = reader.double(); + break; + } + case 4: { + message.protoValue = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 5: { + message.boolValue = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.cloud.channel.v1.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + properties.kind = 1; + if (!$util.isInteger(message.int64Value) && !(message.int64Value && $util.isInteger(message.int64Value.low) && $util.isInteger(message.int64Value.high))) + return "int64Value: integer|Long expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + } + if (message.protoValue != null && message.hasOwnProperty("protoValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Any.verify(message.protoValue); + if (error) + return "protoValue." + error; + } + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Value + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Value) + return object; + var message = new $root.google.cloud.channel.v1.Value(); + if (object.int64Value != null) + if ($util.Long) + (message.int64Value = $util.Long.fromValue(object.int64Value)).unsigned = false; + else if (typeof object.int64Value === "string") + message.int64Value = parseInt(object.int64Value, 10); + else if (typeof object.int64Value === "number") + message.int64Value = object.int64Value; + else if (typeof object.int64Value === "object") + message.int64Value = new $util.LongBits(object.int64Value.low >>> 0, object.int64Value.high >>> 0).toNumber(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.protoValue != null) { + if (typeof object.protoValue !== "object") + throw TypeError(".google.cloud.channel.v1.Value.protoValue: object expected"); + message.protoValue = $root.google.protobuf.Any.fromObject(object.protoValue); + } + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Value + * @static + * @param {google.cloud.channel.v1.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + if (typeof message.int64Value === "number") + object.int64Value = options.longs === String ? String(message.int64Value) : message.int64Value; + else + object.int64Value = options.longs === String ? $util.Long.prototype.toString.call(message.int64Value) : options.longs === Number ? new $util.LongBits(message.int64Value.low >>> 0, message.int64Value.high >>> 0).toNumber() : message.int64Value; + if (options.oneofs) + object.kind = "int64Value"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object.kind = "doubleValue"; + } + if (message.protoValue != null && message.hasOwnProperty("protoValue")) { + object.protoValue = $root.google.protobuf.Any.toObject(message.protoValue, options); + if (options.oneofs) + object.kind = "protoValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Value"; + }; + + return Value; + })(); + + v1.AdminUser = (function() { + + /** + * Properties of an AdminUser. + * @memberof google.cloud.channel.v1 + * @interface IAdminUser + * @property {string|null} [email] AdminUser email + * @property {string|null} [givenName] AdminUser givenName + * @property {string|null} [familyName] AdminUser familyName + */ + + /** + * Constructs a new AdminUser. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an AdminUser. + * @implements IAdminUser + * @constructor + * @param {google.cloud.channel.v1.IAdminUser=} [properties] Properties to set + */ + function AdminUser(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdminUser email. + * @member {string} email + * @memberof google.cloud.channel.v1.AdminUser + * @instance + */ + AdminUser.prototype.email = ""; + + /** + * AdminUser givenName. + * @member {string} givenName + * @memberof google.cloud.channel.v1.AdminUser + * @instance + */ + AdminUser.prototype.givenName = ""; + + /** + * AdminUser familyName. + * @member {string} familyName + * @memberof google.cloud.channel.v1.AdminUser + * @instance + */ + AdminUser.prototype.familyName = ""; + + /** + * Creates a new AdminUser instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {google.cloud.channel.v1.IAdminUser=} [properties] Properties to set + * @returns {google.cloud.channel.v1.AdminUser} AdminUser instance + */ + AdminUser.create = function create(properties) { + return new AdminUser(properties); + }; + + /** + * Encodes the specified AdminUser message. Does not implicitly {@link google.cloud.channel.v1.AdminUser.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {google.cloud.channel.v1.IAdminUser} message AdminUser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdminUser.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.givenName != null && Object.hasOwnProperty.call(message, "givenName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.givenName); + if (message.familyName != null && Object.hasOwnProperty.call(message, "familyName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.familyName); + return writer; + }; + + /** + * Encodes the specified AdminUser message, length delimited. Does not implicitly {@link google.cloud.channel.v1.AdminUser.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {google.cloud.channel.v1.IAdminUser} message AdminUser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdminUser.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdminUser message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.AdminUser} AdminUser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdminUser.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.AdminUser(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + message.givenName = reader.string(); + break; + } + case 3: { + message.familyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdminUser message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.AdminUser} AdminUser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdminUser.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdminUser message. + * @function verify + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdminUser.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.givenName != null && message.hasOwnProperty("givenName")) + if (!$util.isString(message.givenName)) + return "givenName: string expected"; + if (message.familyName != null && message.hasOwnProperty("familyName")) + if (!$util.isString(message.familyName)) + return "familyName: string expected"; + return null; + }; + + /** + * Creates an AdminUser message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.AdminUser} AdminUser + */ + AdminUser.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.AdminUser) + return object; + var message = new $root.google.cloud.channel.v1.AdminUser(); + if (object.email != null) + message.email = String(object.email); + if (object.givenName != null) + message.givenName = String(object.givenName); + if (object.familyName != null) + message.familyName = String(object.familyName); + return message; + }; + + /** + * Creates a plain object from an AdminUser message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {google.cloud.channel.v1.AdminUser} message AdminUser + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdminUser.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.email = ""; + object.givenName = ""; + object.familyName = ""; + } + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.givenName != null && message.hasOwnProperty("givenName")) + object.givenName = message.givenName; + if (message.familyName != null && message.hasOwnProperty("familyName")) + object.familyName = message.familyName; + return object; + }; + + /** + * Converts this AdminUser to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.AdminUser + * @instance + * @returns {Object.} JSON object + */ + AdminUser.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdminUser + * @function getTypeUrl + * @memberof google.cloud.channel.v1.AdminUser + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdminUser.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.AdminUser"; + }; + + return AdminUser; + })(); + + v1.Customer = (function() { + + /** + * Properties of a Customer. + * @memberof google.cloud.channel.v1 + * @interface ICustomer + * @property {string|null} [name] Customer name + * @property {string|null} [orgDisplayName] Customer orgDisplayName + * @property {google.type.IPostalAddress|null} [orgPostalAddress] Customer orgPostalAddress + * @property {google.cloud.channel.v1.IContactInfo|null} [primaryContactInfo] Customer primaryContactInfo + * @property {string|null} [alternateEmail] Customer alternateEmail + * @property {string|null} [domain] Customer domain + * @property {google.protobuf.ITimestamp|null} [createTime] Customer createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Customer updateTime + * @property {string|null} [cloudIdentityId] Customer cloudIdentityId + * @property {string|null} [languageCode] Customer languageCode + * @property {google.cloud.channel.v1.ICloudIdentityInfo|null} [cloudIdentityInfo] Customer cloudIdentityInfo + * @property {string|null} [channelPartnerId] Customer channelPartnerId + */ + + /** + * Constructs a new Customer. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Customer. + * @implements ICustomer + * @constructor + * @param {google.cloud.channel.v1.ICustomer=} [properties] Properties to set + */ + function Customer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Customer name. + * @member {string} name + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.name = ""; + + /** + * Customer orgDisplayName. + * @member {string} orgDisplayName + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.orgDisplayName = ""; + + /** + * Customer orgPostalAddress. + * @member {google.type.IPostalAddress|null|undefined} orgPostalAddress + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.orgPostalAddress = null; + + /** + * Customer primaryContactInfo. + * @member {google.cloud.channel.v1.IContactInfo|null|undefined} primaryContactInfo + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.primaryContactInfo = null; + + /** + * Customer alternateEmail. + * @member {string} alternateEmail + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.alternateEmail = ""; + + /** + * Customer domain. + * @member {string} domain + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.domain = ""; + + /** + * Customer createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.createTime = null; + + /** + * Customer updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.updateTime = null; + + /** + * Customer cloudIdentityId. + * @member {string} cloudIdentityId + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.cloudIdentityId = ""; + + /** + * Customer languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.languageCode = ""; + + /** + * Customer cloudIdentityInfo. + * @member {google.cloud.channel.v1.ICloudIdentityInfo|null|undefined} cloudIdentityInfo + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.cloudIdentityInfo = null; + + /** + * Customer channelPartnerId. + * @member {string} channelPartnerId + * @memberof google.cloud.channel.v1.Customer + * @instance + */ + Customer.prototype.channelPartnerId = ""; + + /** + * Creates a new Customer instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {google.cloud.channel.v1.ICustomer=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Customer} Customer instance + */ + Customer.create = function create(properties) { + return new Customer(properties); + }; + + /** + * Encodes the specified Customer message. Does not implicitly {@link google.cloud.channel.v1.Customer.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {google.cloud.channel.v1.ICustomer} message Customer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Customer.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.orgDisplayName != null && Object.hasOwnProperty.call(message, "orgDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.orgDisplayName); + if (message.orgPostalAddress != null && Object.hasOwnProperty.call(message, "orgPostalAddress")) + $root.google.type.PostalAddress.encode(message.orgPostalAddress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.primaryContactInfo != null && Object.hasOwnProperty.call(message, "primaryContactInfo")) + $root.google.cloud.channel.v1.ContactInfo.encode(message.primaryContactInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.alternateEmail != null && Object.hasOwnProperty.call(message, "alternateEmail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.alternateEmail); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.domain); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.cloudIdentityId != null && Object.hasOwnProperty.call(message, "cloudIdentityId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.cloudIdentityId); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + if (message.cloudIdentityInfo != null && Object.hasOwnProperty.call(message, "cloudIdentityInfo")) + $root.google.cloud.channel.v1.CloudIdentityInfo.encode(message.cloudIdentityInfo, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.channelPartnerId != null && Object.hasOwnProperty.call(message, "channelPartnerId")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.channelPartnerId); + return writer; + }; + + /** + * Encodes the specified Customer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Customer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {google.cloud.channel.v1.ICustomer} message Customer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Customer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Customer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Customer} Customer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Customer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Customer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.orgDisplayName = reader.string(); + break; + } + case 3: { + message.orgPostalAddress = $root.google.type.PostalAddress.decode(reader, reader.uint32()); + break; + } + case 4: { + message.primaryContactInfo = $root.google.cloud.channel.v1.ContactInfo.decode(reader, reader.uint32()); + break; + } + case 5: { + message.alternateEmail = reader.string(); + break; + } + case 6: { + message.domain = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.cloudIdentityId = reader.string(); + break; + } + case 10: { + message.languageCode = reader.string(); + break; + } + case 12: { + message.cloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.decode(reader, reader.uint32()); + break; + } + case 13: { + message.channelPartnerId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Customer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Customer} Customer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Customer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Customer message. + * @function verify + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Customer.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.orgDisplayName != null && message.hasOwnProperty("orgDisplayName")) + if (!$util.isString(message.orgDisplayName)) + return "orgDisplayName: string expected"; + if (message.orgPostalAddress != null && message.hasOwnProperty("orgPostalAddress")) { + var error = $root.google.type.PostalAddress.verify(message.orgPostalAddress); + if (error) + return "orgPostalAddress." + error; + } + if (message.primaryContactInfo != null && message.hasOwnProperty("primaryContactInfo")) { + var error = $root.google.cloud.channel.v1.ContactInfo.verify(message.primaryContactInfo); + if (error) + return "primaryContactInfo." + error; + } + if (message.alternateEmail != null && message.hasOwnProperty("alternateEmail")) + if (!$util.isString(message.alternateEmail)) + return "alternateEmail: string expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: 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.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) + if (!$util.isString(message.cloudIdentityId)) + return "cloudIdentityId: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.cloudIdentityInfo != null && message.hasOwnProperty("cloudIdentityInfo")) { + var error = $root.google.cloud.channel.v1.CloudIdentityInfo.verify(message.cloudIdentityInfo); + if (error) + return "cloudIdentityInfo." + error; + } + if (message.channelPartnerId != null && message.hasOwnProperty("channelPartnerId")) + if (!$util.isString(message.channelPartnerId)) + return "channelPartnerId: string expected"; + return null; + }; + + /** + * Creates a Customer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Customer} Customer + */ + Customer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Customer) + return object; + var message = new $root.google.cloud.channel.v1.Customer(); + if (object.name != null) + message.name = String(object.name); + if (object.orgDisplayName != null) + message.orgDisplayName = String(object.orgDisplayName); + if (object.orgPostalAddress != null) { + if (typeof object.orgPostalAddress !== "object") + throw TypeError(".google.cloud.channel.v1.Customer.orgPostalAddress: object expected"); + message.orgPostalAddress = $root.google.type.PostalAddress.fromObject(object.orgPostalAddress); + } + if (object.primaryContactInfo != null) { + if (typeof object.primaryContactInfo !== "object") + throw TypeError(".google.cloud.channel.v1.Customer.primaryContactInfo: object expected"); + message.primaryContactInfo = $root.google.cloud.channel.v1.ContactInfo.fromObject(object.primaryContactInfo); + } + if (object.alternateEmail != null) + message.alternateEmail = String(object.alternateEmail); + if (object.domain != null) + message.domain = String(object.domain); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.channel.v1.Customer.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.channel.v1.Customer.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.cloudIdentityId != null) + message.cloudIdentityId = String(object.cloudIdentityId); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.cloudIdentityInfo != null) { + if (typeof object.cloudIdentityInfo !== "object") + throw TypeError(".google.cloud.channel.v1.Customer.cloudIdentityInfo: object expected"); + message.cloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.fromObject(object.cloudIdentityInfo); + } + if (object.channelPartnerId != null) + message.channelPartnerId = String(object.channelPartnerId); + return message; + }; + + /** + * Creates a plain object from a Customer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {google.cloud.channel.v1.Customer} message Customer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Customer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.orgDisplayName = ""; + object.orgPostalAddress = null; + object.primaryContactInfo = null; + object.alternateEmail = ""; + object.domain = ""; + object.createTime = null; + object.updateTime = null; + object.cloudIdentityId = ""; + object.languageCode = ""; + object.cloudIdentityInfo = null; + object.channelPartnerId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.orgDisplayName != null && message.hasOwnProperty("orgDisplayName")) + object.orgDisplayName = message.orgDisplayName; + if (message.orgPostalAddress != null && message.hasOwnProperty("orgPostalAddress")) + object.orgPostalAddress = $root.google.type.PostalAddress.toObject(message.orgPostalAddress, options); + if (message.primaryContactInfo != null && message.hasOwnProperty("primaryContactInfo")) + object.primaryContactInfo = $root.google.cloud.channel.v1.ContactInfo.toObject(message.primaryContactInfo, options); + if (message.alternateEmail != null && message.hasOwnProperty("alternateEmail")) + object.alternateEmail = message.alternateEmail; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + 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.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) + object.cloudIdentityId = message.cloudIdentityId; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.cloudIdentityInfo != null && message.hasOwnProperty("cloudIdentityInfo")) + object.cloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.toObject(message.cloudIdentityInfo, options); + if (message.channelPartnerId != null && message.hasOwnProperty("channelPartnerId")) + object.channelPartnerId = message.channelPartnerId; + return object; + }; + + /** + * Converts this Customer to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Customer + * @instance + * @returns {Object.} JSON object + */ + Customer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Customer + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Customer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Customer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Customer"; + }; + + return Customer; + })(); + + v1.ContactInfo = (function() { + + /** + * Properties of a ContactInfo. + * @memberof google.cloud.channel.v1 + * @interface IContactInfo + * @property {string|null} [firstName] ContactInfo firstName + * @property {string|null} [lastName] ContactInfo lastName + * @property {string|null} [displayName] ContactInfo displayName + * @property {string|null} [email] ContactInfo email + * @property {string|null} [title] ContactInfo title + * @property {string|null} [phone] ContactInfo phone + */ + + /** + * Constructs a new ContactInfo. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ContactInfo. + * @implements IContactInfo + * @constructor + * @param {google.cloud.channel.v1.IContactInfo=} [properties] Properties to set + */ + function ContactInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContactInfo firstName. + * @member {string} firstName + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + */ + ContactInfo.prototype.firstName = ""; + + /** + * ContactInfo lastName. + * @member {string} lastName + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + */ + ContactInfo.prototype.lastName = ""; + + /** + * ContactInfo displayName. + * @member {string} displayName + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + */ + ContactInfo.prototype.displayName = ""; + + /** + * ContactInfo email. + * @member {string} email + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + */ + ContactInfo.prototype.email = ""; + + /** + * ContactInfo title. + * @member {string} title + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + */ + ContactInfo.prototype.title = ""; + + /** + * ContactInfo phone. + * @member {string} phone + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + */ + ContactInfo.prototype.phone = ""; + + /** + * Creates a new ContactInfo instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {google.cloud.channel.v1.IContactInfo=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ContactInfo} ContactInfo instance + */ + ContactInfo.create = function create(properties) { + return new ContactInfo(properties); + }; + + /** + * Encodes the specified ContactInfo message. Does not implicitly {@link google.cloud.channel.v1.ContactInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {google.cloud.channel.v1.IContactInfo} message ContactInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstName != null && Object.hasOwnProperty.call(message, "firstName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstName); + if (message.lastName != null && Object.hasOwnProperty.call(message, "lastName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.lastName); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.email); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.title); + if (message.phone != null && Object.hasOwnProperty.call(message, "phone")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.phone); + return writer; + }; + + /** + * Encodes the specified ContactInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ContactInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {google.cloud.channel.v1.IContactInfo} message ContactInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContactInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContactInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ContactInfo} ContactInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ContactInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.firstName = reader.string(); + break; + } + case 2: { + message.lastName = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.email = reader.string(); + break; + } + case 6: { + message.title = reader.string(); + break; + } + case 7: { + message.phone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContactInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ContactInfo} ContactInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContactInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContactInfo message. + * @function verify + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContactInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstName != null && message.hasOwnProperty("firstName")) + if (!$util.isString(message.firstName)) + return "firstName: string expected"; + if (message.lastName != null && message.hasOwnProperty("lastName")) + if (!$util.isString(message.lastName)) + return "lastName: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.phone != null && message.hasOwnProperty("phone")) + if (!$util.isString(message.phone)) + return "phone: string expected"; + return null; + }; + + /** + * Creates a ContactInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ContactInfo} ContactInfo + */ + ContactInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ContactInfo) + return object; + var message = new $root.google.cloud.channel.v1.ContactInfo(); + if (object.firstName != null) + message.firstName = String(object.firstName); + if (object.lastName != null) + message.lastName = String(object.lastName); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.email != null) + message.email = String(object.email); + if (object.title != null) + message.title = String(object.title); + if (object.phone != null) + message.phone = String(object.phone); + return message; + }; + + /** + * Creates a plain object from a ContactInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {google.cloud.channel.v1.ContactInfo} message ContactInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContactInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstName = ""; + object.lastName = ""; + object.displayName = ""; + object.email = ""; + object.title = ""; + object.phone = ""; + } + if (message.firstName != null && message.hasOwnProperty("firstName")) + object.firstName = message.firstName; + if (message.lastName != null && message.hasOwnProperty("lastName")) + object.lastName = message.lastName; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.phone != null && message.hasOwnProperty("phone")) + object.phone = message.phone; + return object; + }; + + /** + * Converts this ContactInfo to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ContactInfo + * @instance + * @returns {Object.} JSON object + */ + ContactInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContactInfo + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ContactInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContactInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ContactInfo"; + }; + + return ContactInfo; + })(); + + v1.Entitlement = (function() { + + /** + * Properties of an Entitlement. + * @memberof google.cloud.channel.v1 + * @interface IEntitlement + * @property {string|null} [name] Entitlement name + * @property {google.protobuf.ITimestamp|null} [createTime] Entitlement createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Entitlement updateTime + * @property {string|null} [offer] Entitlement offer + * @property {google.cloud.channel.v1.ICommitmentSettings|null} [commitmentSettings] Entitlement commitmentSettings + * @property {google.cloud.channel.v1.Entitlement.ProvisioningState|null} [provisioningState] Entitlement provisioningState + * @property {google.cloud.channel.v1.IProvisionedService|null} [provisionedService] Entitlement provisionedService + * @property {Array.|null} [suspensionReasons] Entitlement suspensionReasons + * @property {string|null} [purchaseOrderId] Entitlement purchaseOrderId + * @property {google.cloud.channel.v1.ITrialSettings|null} [trialSettings] Entitlement trialSettings + * @property {google.cloud.channel.v1.IAssociationInfo|null} [associationInfo] Entitlement associationInfo + * @property {Array.|null} [parameters] Entitlement parameters + */ + + /** + * Constructs a new Entitlement. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an Entitlement. + * @implements IEntitlement + * @constructor + * @param {google.cloud.channel.v1.IEntitlement=} [properties] Properties to set + */ + function Entitlement(properties) { + this.suspensionReasons = []; + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entitlement name. + * @member {string} name + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.name = ""; + + /** + * Entitlement createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.createTime = null; + + /** + * Entitlement updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.updateTime = null; + + /** + * Entitlement offer. + * @member {string} offer + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.offer = ""; + + /** + * Entitlement commitmentSettings. + * @member {google.cloud.channel.v1.ICommitmentSettings|null|undefined} commitmentSettings + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.commitmentSettings = null; + + /** + * Entitlement provisioningState. + * @member {google.cloud.channel.v1.Entitlement.ProvisioningState} provisioningState + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.provisioningState = 0; + + /** + * Entitlement provisionedService. + * @member {google.cloud.channel.v1.IProvisionedService|null|undefined} provisionedService + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.provisionedService = null; + + /** + * Entitlement suspensionReasons. + * @member {Array.} suspensionReasons + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.suspensionReasons = $util.emptyArray; + + /** + * Entitlement purchaseOrderId. + * @member {string} purchaseOrderId + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.purchaseOrderId = ""; + + /** + * Entitlement trialSettings. + * @member {google.cloud.channel.v1.ITrialSettings|null|undefined} trialSettings + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.trialSettings = null; + + /** + * Entitlement associationInfo. + * @member {google.cloud.channel.v1.IAssociationInfo|null|undefined} associationInfo + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.associationInfo = null; + + /** + * Entitlement parameters. + * @member {Array.} parameters + * @memberof google.cloud.channel.v1.Entitlement + * @instance + */ + Entitlement.prototype.parameters = $util.emptyArray; + + /** + * Creates a new Entitlement instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {google.cloud.channel.v1.IEntitlement=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Entitlement} Entitlement instance + */ + Entitlement.create = function create(properties) { + return new Entitlement(properties); + }; + + /** + * Encodes the specified Entitlement message. Does not implicitly {@link google.cloud.channel.v1.Entitlement.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {google.cloud.channel.v1.IEntitlement} message Entitlement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entitlement.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 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.offer); + if (message.commitmentSettings != null && Object.hasOwnProperty.call(message, "commitmentSettings")) + $root.google.cloud.channel.v1.CommitmentSettings.encode(message.commitmentSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.provisioningState != null && Object.hasOwnProperty.call(message, "provisioningState")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.provisioningState); + if (message.provisionedService != null && Object.hasOwnProperty.call(message, "provisionedService")) + $root.google.cloud.channel.v1.ProvisionedService.encode(message.provisionedService, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.suspensionReasons != null && message.suspensionReasons.length) { + writer.uint32(/* id 18, wireType 2 =*/146).fork(); + for (var i = 0; i < message.suspensionReasons.length; ++i) + writer.int32(message.suspensionReasons[i]); + writer.ldelim(); + } + if (message.purchaseOrderId != null && Object.hasOwnProperty.call(message, "purchaseOrderId")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.purchaseOrderId); + if (message.trialSettings != null && Object.hasOwnProperty.call(message, "trialSettings")) + $root.google.cloud.channel.v1.TrialSettings.encode(message.trialSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.associationInfo != null && Object.hasOwnProperty.call(message, "associationInfo")) + $root.google.cloud.channel.v1.AssociationInfo.encode(message.associationInfo, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.channel.v1.Parameter.encode(message.parameters[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Entitlement message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Entitlement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {google.cloud.channel.v1.IEntitlement} message Entitlement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entitlement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entitlement message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Entitlement} Entitlement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entitlement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Entitlement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.offer = reader.string(); + break; + } + case 12: { + message.commitmentSettings = $root.google.cloud.channel.v1.CommitmentSettings.decode(reader, reader.uint32()); + break; + } + case 13: { + message.provisioningState = reader.int32(); + break; + } + case 16: { + message.provisionedService = $root.google.cloud.channel.v1.ProvisionedService.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.suspensionReasons && message.suspensionReasons.length)) + message.suspensionReasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.suspensionReasons.push(reader.int32()); + } else + message.suspensionReasons.push(reader.int32()); + break; + } + case 19: { + message.purchaseOrderId = reader.string(); + break; + } + case 21: { + message.trialSettings = $root.google.cloud.channel.v1.TrialSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.associationInfo = $root.google.cloud.channel.v1.AssociationInfo.decode(reader, reader.uint32()); + break; + } + case 26: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.channel.v1.Parameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entitlement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Entitlement} Entitlement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entitlement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entitlement message. + * @function verify + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entitlement.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.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.commitmentSettings != null && message.hasOwnProperty("commitmentSettings")) { + var error = $root.google.cloud.channel.v1.CommitmentSettings.verify(message.commitmentSettings); + if (error) + return "commitmentSettings." + error; + } + if (message.provisioningState != null && message.hasOwnProperty("provisioningState")) + switch (message.provisioningState) { + default: + return "provisioningState: enum value expected"; + case 0: + case 1: + case 5: + break; + } + if (message.provisionedService != null && message.hasOwnProperty("provisionedService")) { + var error = $root.google.cloud.channel.v1.ProvisionedService.verify(message.provisionedService); + if (error) + return "provisionedService." + error; + } + if (message.suspensionReasons != null && message.hasOwnProperty("suspensionReasons")) { + if (!Array.isArray(message.suspensionReasons)) + return "suspensionReasons: array expected"; + for (var i = 0; i < message.suspensionReasons.length; ++i) + switch (message.suspensionReasons[i]) { + default: + return "suspensionReasons: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 100: + break; + } + } + if (message.purchaseOrderId != null && message.hasOwnProperty("purchaseOrderId")) + if (!$util.isString(message.purchaseOrderId)) + return "purchaseOrderId: string expected"; + if (message.trialSettings != null && message.hasOwnProperty("trialSettings")) { + var error = $root.google.cloud.channel.v1.TrialSettings.verify(message.trialSettings); + if (error) + return "trialSettings." + error; + } + if (message.associationInfo != null && message.hasOwnProperty("associationInfo")) { + var error = $root.google.cloud.channel.v1.AssociationInfo.verify(message.associationInfo); + if (error) + return "associationInfo." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.channel.v1.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates an Entitlement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Entitlement} Entitlement + */ + Entitlement.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Entitlement) + return object; + var message = new $root.google.cloud.channel.v1.Entitlement(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.channel.v1.Entitlement.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.channel.v1.Entitlement.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.offer != null) + message.offer = String(object.offer); + if (object.commitmentSettings != null) { + if (typeof object.commitmentSettings !== "object") + throw TypeError(".google.cloud.channel.v1.Entitlement.commitmentSettings: object expected"); + message.commitmentSettings = $root.google.cloud.channel.v1.CommitmentSettings.fromObject(object.commitmentSettings); + } + switch (object.provisioningState) { + default: + if (typeof object.provisioningState === "number") { + message.provisioningState = object.provisioningState; + break; + } + break; + case "PROVISIONING_STATE_UNSPECIFIED": + case 0: + message.provisioningState = 0; + break; + case "ACTIVE": + case 1: + message.provisioningState = 1; + break; + case "SUSPENDED": + case 5: + message.provisioningState = 5; + break; + } + if (object.provisionedService != null) { + if (typeof object.provisionedService !== "object") + throw TypeError(".google.cloud.channel.v1.Entitlement.provisionedService: object expected"); + message.provisionedService = $root.google.cloud.channel.v1.ProvisionedService.fromObject(object.provisionedService); + } + if (object.suspensionReasons) { + if (!Array.isArray(object.suspensionReasons)) + throw TypeError(".google.cloud.channel.v1.Entitlement.suspensionReasons: array expected"); + message.suspensionReasons = []; + for (var i = 0; i < object.suspensionReasons.length; ++i) + switch (object.suspensionReasons[i]) { + default: + if (typeof object.suspensionReasons[i] === "number") { + message.suspensionReasons[i] = object.suspensionReasons[i]; + break; + } + case "SUSPENSION_REASON_UNSPECIFIED": + case 0: + message.suspensionReasons[i] = 0; + break; + case "RESELLER_INITIATED": + case 1: + message.suspensionReasons[i] = 1; + break; + case "TRIAL_ENDED": + case 2: + message.suspensionReasons[i] = 2; + break; + case "RENEWAL_WITH_TYPE_CANCEL": + case 3: + message.suspensionReasons[i] = 3; + break; + case "PENDING_TOS_ACCEPTANCE": + case 4: + message.suspensionReasons[i] = 4; + break; + case "OTHER": + case 100: + message.suspensionReasons[i] = 100; + break; + } + } + if (object.purchaseOrderId != null) + message.purchaseOrderId = String(object.purchaseOrderId); + if (object.trialSettings != null) { + if (typeof object.trialSettings !== "object") + throw TypeError(".google.cloud.channel.v1.Entitlement.trialSettings: object expected"); + message.trialSettings = $root.google.cloud.channel.v1.TrialSettings.fromObject(object.trialSettings); + } + if (object.associationInfo != null) { + if (typeof object.associationInfo !== "object") + throw TypeError(".google.cloud.channel.v1.Entitlement.associationInfo: object expected"); + message.associationInfo = $root.google.cloud.channel.v1.AssociationInfo.fromObject(object.associationInfo); + } + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.channel.v1.Entitlement.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.channel.v1.Entitlement.parameters: object expected"); + message.parameters[i] = $root.google.cloud.channel.v1.Parameter.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Entitlement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {google.cloud.channel.v1.Entitlement} message Entitlement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entitlement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.suspensionReasons = []; + object.parameters = []; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.offer = ""; + object.commitmentSettings = null; + object.provisioningState = options.enums === String ? "PROVISIONING_STATE_UNSPECIFIED" : 0; + object.provisionedService = null; + object.purchaseOrderId = ""; + object.trialSettings = null; + object.associationInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + if (message.commitmentSettings != null && message.hasOwnProperty("commitmentSettings")) + object.commitmentSettings = $root.google.cloud.channel.v1.CommitmentSettings.toObject(message.commitmentSettings, options); + if (message.provisioningState != null && message.hasOwnProperty("provisioningState")) + object.provisioningState = options.enums === String ? $root.google.cloud.channel.v1.Entitlement.ProvisioningState[message.provisioningState] === undefined ? message.provisioningState : $root.google.cloud.channel.v1.Entitlement.ProvisioningState[message.provisioningState] : message.provisioningState; + if (message.provisionedService != null && message.hasOwnProperty("provisionedService")) + object.provisionedService = $root.google.cloud.channel.v1.ProvisionedService.toObject(message.provisionedService, options); + if (message.suspensionReasons && message.suspensionReasons.length) { + object.suspensionReasons = []; + for (var j = 0; j < message.suspensionReasons.length; ++j) + object.suspensionReasons[j] = options.enums === String ? $root.google.cloud.channel.v1.Entitlement.SuspensionReason[message.suspensionReasons[j]] === undefined ? message.suspensionReasons[j] : $root.google.cloud.channel.v1.Entitlement.SuspensionReason[message.suspensionReasons[j]] : message.suspensionReasons[j]; + } + if (message.purchaseOrderId != null && message.hasOwnProperty("purchaseOrderId")) + object.purchaseOrderId = message.purchaseOrderId; + if (message.trialSettings != null && message.hasOwnProperty("trialSettings")) + object.trialSettings = $root.google.cloud.channel.v1.TrialSettings.toObject(message.trialSettings, options); + if (message.associationInfo != null && message.hasOwnProperty("associationInfo")) + object.associationInfo = $root.google.cloud.channel.v1.AssociationInfo.toObject(message.associationInfo, options); + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.channel.v1.Parameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this Entitlement to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Entitlement + * @instance + * @returns {Object.} JSON object + */ + Entitlement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entitlement + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Entitlement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entitlement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Entitlement"; + }; + + /** + * ProvisioningState enum. + * @name google.cloud.channel.v1.Entitlement.ProvisioningState + * @enum {number} + * @property {number} PROVISIONING_STATE_UNSPECIFIED=0 PROVISIONING_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} SUSPENDED=5 SUSPENDED value + */ + Entitlement.ProvisioningState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[5] = "SUSPENDED"] = 5; + return values; + })(); + + /** + * SuspensionReason enum. + * @name google.cloud.channel.v1.Entitlement.SuspensionReason + * @enum {number} + * @property {number} SUSPENSION_REASON_UNSPECIFIED=0 SUSPENSION_REASON_UNSPECIFIED value + * @property {number} RESELLER_INITIATED=1 RESELLER_INITIATED value + * @property {number} TRIAL_ENDED=2 TRIAL_ENDED value + * @property {number} RENEWAL_WITH_TYPE_CANCEL=3 RENEWAL_WITH_TYPE_CANCEL value + * @property {number} PENDING_TOS_ACCEPTANCE=4 PENDING_TOS_ACCEPTANCE value + * @property {number} OTHER=100 OTHER value + */ + Entitlement.SuspensionReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUSPENSION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESELLER_INITIATED"] = 1; + values[valuesById[2] = "TRIAL_ENDED"] = 2; + values[valuesById[3] = "RENEWAL_WITH_TYPE_CANCEL"] = 3; + values[valuesById[4] = "PENDING_TOS_ACCEPTANCE"] = 4; + values[valuesById[100] = "OTHER"] = 100; + return values; + })(); + + return Entitlement; + })(); + + v1.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.cloud.channel.v1 + * @interface IParameter + * @property {string|null} [name] Parameter name + * @property {google.cloud.channel.v1.IValue|null} [value] Parameter value + * @property {boolean|null} [editable] Parameter editable + */ + + /** + * Constructs a new Parameter. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.channel.v1.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter name. + * @member {string} name + * @memberof google.cloud.channel.v1.Parameter + * @instance + */ + Parameter.prototype.name = ""; + + /** + * Parameter value. + * @member {google.cloud.channel.v1.IValue|null|undefined} value + * @memberof google.cloud.channel.v1.Parameter + * @instance + */ + Parameter.prototype.value = null; + + /** + * Parameter editable. + * @member {boolean} editable + * @memberof google.cloud.channel.v1.Parameter + * @instance + */ + Parameter.prototype.editable = false; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {google.cloud.channel.v1.IParameter=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.channel.v1.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {google.cloud.channel.v1.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.cloud.channel.v1.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.editable != null && Object.hasOwnProperty.call(message, "editable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.editable); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {google.cloud.channel.v1.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = $root.google.cloud.channel.v1.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.editable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.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")) { + var error = $root.google.cloud.channel.v1.Value.verify(message.value); + if (error) + return "value." + error; + } + if (message.editable != null && message.hasOwnProperty("editable")) + if (typeof message.editable !== "boolean") + return "editable: boolean expected"; + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Parameter) + return object; + var message = new $root.google.cloud.channel.v1.Parameter(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.channel.v1.Parameter.value: object expected"); + message.value = $root.google.cloud.channel.v1.Value.fromObject(object.value); + } + if (object.editable != null) + message.editable = Boolean(object.editable); + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {google.cloud.channel.v1.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = null; + object.editable = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.cloud.channel.v1.Value.toObject(message.value, options); + if (message.editable != null && message.hasOwnProperty("editable")) + object.editable = message.editable; + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Parameter"; + }; + + return Parameter; + })(); + + v1.AssociationInfo = (function() { + + /** + * Properties of an AssociationInfo. + * @memberof google.cloud.channel.v1 + * @interface IAssociationInfo + * @property {string|null} [baseEntitlement] AssociationInfo baseEntitlement + */ + + /** + * Constructs a new AssociationInfo. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an AssociationInfo. + * @implements IAssociationInfo + * @constructor + * @param {google.cloud.channel.v1.IAssociationInfo=} [properties] Properties to set + */ + function AssociationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssociationInfo baseEntitlement. + * @member {string} baseEntitlement + * @memberof google.cloud.channel.v1.AssociationInfo + * @instance + */ + AssociationInfo.prototype.baseEntitlement = ""; + + /** + * Creates a new AssociationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {google.cloud.channel.v1.IAssociationInfo=} [properties] Properties to set + * @returns {google.cloud.channel.v1.AssociationInfo} AssociationInfo instance + */ + AssociationInfo.create = function create(properties) { + return new AssociationInfo(properties); + }; + + /** + * Encodes the specified AssociationInfo message. Does not implicitly {@link google.cloud.channel.v1.AssociationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {google.cloud.channel.v1.IAssociationInfo} message AssociationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseEntitlement != null && Object.hasOwnProperty.call(message, "baseEntitlement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseEntitlement); + return writer; + }; + + /** + * Encodes the specified AssociationInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.AssociationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {google.cloud.channel.v1.IAssociationInfo} message AssociationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssociationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.AssociationInfo} AssociationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.AssociationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseEntitlement = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssociationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.AssociationInfo} AssociationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssociationInfo message. + * @function verify + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssociationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseEntitlement != null && message.hasOwnProperty("baseEntitlement")) + if (!$util.isString(message.baseEntitlement)) + return "baseEntitlement: string expected"; + return null; + }; + + /** + * Creates an AssociationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.AssociationInfo} AssociationInfo + */ + AssociationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.AssociationInfo) + return object; + var message = new $root.google.cloud.channel.v1.AssociationInfo(); + if (object.baseEntitlement != null) + message.baseEntitlement = String(object.baseEntitlement); + return message; + }; + + /** + * Creates a plain object from an AssociationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {google.cloud.channel.v1.AssociationInfo} message AssociationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssociationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.baseEntitlement = ""; + if (message.baseEntitlement != null && message.hasOwnProperty("baseEntitlement")) + object.baseEntitlement = message.baseEntitlement; + return object; + }; + + /** + * Converts this AssociationInfo to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.AssociationInfo + * @instance + * @returns {Object.} JSON object + */ + AssociationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssociationInfo + * @function getTypeUrl + * @memberof google.cloud.channel.v1.AssociationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssociationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.AssociationInfo"; + }; + + return AssociationInfo; + })(); + + v1.ProvisionedService = (function() { + + /** + * Properties of a ProvisionedService. + * @memberof google.cloud.channel.v1 + * @interface IProvisionedService + * @property {string|null} [provisioningId] ProvisionedService provisioningId + * @property {string|null} [productId] ProvisionedService productId + * @property {string|null} [skuId] ProvisionedService skuId + */ + + /** + * Constructs a new ProvisionedService. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ProvisionedService. + * @implements IProvisionedService + * @constructor + * @param {google.cloud.channel.v1.IProvisionedService=} [properties] Properties to set + */ + function ProvisionedService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProvisionedService provisioningId. + * @member {string} provisioningId + * @memberof google.cloud.channel.v1.ProvisionedService + * @instance + */ + ProvisionedService.prototype.provisioningId = ""; + + /** + * ProvisionedService productId. + * @member {string} productId + * @memberof google.cloud.channel.v1.ProvisionedService + * @instance + */ + ProvisionedService.prototype.productId = ""; + + /** + * ProvisionedService skuId. + * @member {string} skuId + * @memberof google.cloud.channel.v1.ProvisionedService + * @instance + */ + ProvisionedService.prototype.skuId = ""; + + /** + * Creates a new ProvisionedService instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {google.cloud.channel.v1.IProvisionedService=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ProvisionedService} ProvisionedService instance + */ + ProvisionedService.create = function create(properties) { + return new ProvisionedService(properties); + }; + + /** + * Encodes the specified ProvisionedService message. Does not implicitly {@link google.cloud.channel.v1.ProvisionedService.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {google.cloud.channel.v1.IProvisionedService} message ProvisionedService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisionedService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.provisioningId != null && Object.hasOwnProperty.call(message, "provisioningId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.provisioningId); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.productId); + if (message.skuId != null && Object.hasOwnProperty.call(message, "skuId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.skuId); + return writer; + }; + + /** + * Encodes the specified ProvisionedService message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ProvisionedService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {google.cloud.channel.v1.IProvisionedService} message ProvisionedService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisionedService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProvisionedService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ProvisionedService} ProvisionedService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisionedService.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ProvisionedService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.provisioningId = reader.string(); + break; + } + case 2: { + message.productId = reader.string(); + break; + } + case 3: { + message.skuId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProvisionedService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ProvisionedService} ProvisionedService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisionedService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProvisionedService message. + * @function verify + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProvisionedService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.provisioningId != null && message.hasOwnProperty("provisioningId")) + if (!$util.isString(message.provisioningId)) + return "provisioningId: string expected"; + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + if (message.skuId != null && message.hasOwnProperty("skuId")) + if (!$util.isString(message.skuId)) + return "skuId: string expected"; + return null; + }; + + /** + * Creates a ProvisionedService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ProvisionedService} ProvisionedService + */ + ProvisionedService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ProvisionedService) + return object; + var message = new $root.google.cloud.channel.v1.ProvisionedService(); + if (object.provisioningId != null) + message.provisioningId = String(object.provisioningId); + if (object.productId != null) + message.productId = String(object.productId); + if (object.skuId != null) + message.skuId = String(object.skuId); + return message; + }; + + /** + * Creates a plain object from a ProvisionedService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {google.cloud.channel.v1.ProvisionedService} message ProvisionedService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProvisionedService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.provisioningId = ""; + object.productId = ""; + object.skuId = ""; + } + if (message.provisioningId != null && message.hasOwnProperty("provisioningId")) + object.provisioningId = message.provisioningId; + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + if (message.skuId != null && message.hasOwnProperty("skuId")) + object.skuId = message.skuId; + return object; + }; + + /** + * Converts this ProvisionedService to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ProvisionedService + * @instance + * @returns {Object.} JSON object + */ + ProvisionedService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProvisionedService + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ProvisionedService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProvisionedService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ProvisionedService"; + }; + + return ProvisionedService; + })(); + + v1.CommitmentSettings = (function() { + + /** + * Properties of a CommitmentSettings. + * @memberof google.cloud.channel.v1 + * @interface ICommitmentSettings + * @property {google.protobuf.ITimestamp|null} [startTime] CommitmentSettings startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CommitmentSettings endTime + * @property {google.cloud.channel.v1.IRenewalSettings|null} [renewalSettings] CommitmentSettings renewalSettings + */ + + /** + * Constructs a new CommitmentSettings. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CommitmentSettings. + * @implements ICommitmentSettings + * @constructor + * @param {google.cloud.channel.v1.ICommitmentSettings=} [properties] Properties to set + */ + function CommitmentSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitmentSettings startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.channel.v1.CommitmentSettings + * @instance + */ + CommitmentSettings.prototype.startTime = null; + + /** + * CommitmentSettings endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.channel.v1.CommitmentSettings + * @instance + */ + CommitmentSettings.prototype.endTime = null; + + /** + * CommitmentSettings renewalSettings. + * @member {google.cloud.channel.v1.IRenewalSettings|null|undefined} renewalSettings + * @memberof google.cloud.channel.v1.CommitmentSettings + * @instance + */ + CommitmentSettings.prototype.renewalSettings = null; + + /** + * Creates a new CommitmentSettings instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {google.cloud.channel.v1.ICommitmentSettings=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CommitmentSettings} CommitmentSettings instance + */ + CommitmentSettings.create = function create(properties) { + return new CommitmentSettings(properties); + }; + + /** + * Encodes the specified CommitmentSettings message. Does not implicitly {@link google.cloud.channel.v1.CommitmentSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {google.cloud.channel.v1.ICommitmentSettings} message CommitmentSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentSettings.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.renewalSettings != null && Object.hasOwnProperty.call(message, "renewalSettings")) + $root.google.cloud.channel.v1.RenewalSettings.encode(message.renewalSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitmentSettings message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CommitmentSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {google.cloud.channel.v1.ICommitmentSettings} message CommitmentSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitmentSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CommitmentSettings} CommitmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CommitmentSettings(); + 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 4: { + message.renewalSettings = $root.google.cloud.channel.v1.RenewalSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitmentSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CommitmentSettings} CommitmentSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitmentSettings message. + * @function verify + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitmentSettings.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.renewalSettings != null && message.hasOwnProperty("renewalSettings")) { + var error = $root.google.cloud.channel.v1.RenewalSettings.verify(message.renewalSettings); + if (error) + return "renewalSettings." + error; + } + return null; + }; + + /** + * Creates a CommitmentSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CommitmentSettings} CommitmentSettings + */ + CommitmentSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CommitmentSettings) + return object; + var message = new $root.google.cloud.channel.v1.CommitmentSettings(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.channel.v1.CommitmentSettings.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.channel.v1.CommitmentSettings.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.renewalSettings != null) { + if (typeof object.renewalSettings !== "object") + throw TypeError(".google.cloud.channel.v1.CommitmentSettings.renewalSettings: object expected"); + message.renewalSettings = $root.google.cloud.channel.v1.RenewalSettings.fromObject(object.renewalSettings); + } + return message; + }; + + /** + * Creates a plain object from a CommitmentSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {google.cloud.channel.v1.CommitmentSettings} message CommitmentSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitmentSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.renewalSettings = null; + } + 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.renewalSettings != null && message.hasOwnProperty("renewalSettings")) + object.renewalSettings = $root.google.cloud.channel.v1.RenewalSettings.toObject(message.renewalSettings, options); + return object; + }; + + /** + * Converts this CommitmentSettings to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CommitmentSettings + * @instance + * @returns {Object.} JSON object + */ + CommitmentSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommitmentSettings + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CommitmentSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommitmentSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CommitmentSettings"; + }; + + return CommitmentSettings; + })(); + + v1.RenewalSettings = (function() { + + /** + * Properties of a RenewalSettings. + * @memberof google.cloud.channel.v1 + * @interface IRenewalSettings + * @property {boolean|null} [enableRenewal] RenewalSettings enableRenewal + * @property {boolean|null} [resizeUnitCount] RenewalSettings resizeUnitCount + * @property {google.cloud.channel.v1.PaymentPlan|null} [paymentPlan] RenewalSettings paymentPlan + * @property {google.cloud.channel.v1.IPeriod|null} [paymentCycle] RenewalSettings paymentCycle + */ + + /** + * Constructs a new RenewalSettings. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RenewalSettings. + * @implements IRenewalSettings + * @constructor + * @param {google.cloud.channel.v1.IRenewalSettings=} [properties] Properties to set + */ + function RenewalSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RenewalSettings enableRenewal. + * @member {boolean} enableRenewal + * @memberof google.cloud.channel.v1.RenewalSettings + * @instance + */ + RenewalSettings.prototype.enableRenewal = false; + + /** + * RenewalSettings resizeUnitCount. + * @member {boolean} resizeUnitCount + * @memberof google.cloud.channel.v1.RenewalSettings + * @instance + */ + RenewalSettings.prototype.resizeUnitCount = false; + + /** + * RenewalSettings paymentPlan. + * @member {google.cloud.channel.v1.PaymentPlan} paymentPlan + * @memberof google.cloud.channel.v1.RenewalSettings + * @instance + */ + RenewalSettings.prototype.paymentPlan = 0; + + /** + * RenewalSettings paymentCycle. + * @member {google.cloud.channel.v1.IPeriod|null|undefined} paymentCycle + * @memberof google.cloud.channel.v1.RenewalSettings + * @instance + */ + RenewalSettings.prototype.paymentCycle = null; + + /** + * Creates a new RenewalSettings instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {google.cloud.channel.v1.IRenewalSettings=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RenewalSettings} RenewalSettings instance + */ + RenewalSettings.create = function create(properties) { + return new RenewalSettings(properties); + }; + + /** + * Encodes the specified RenewalSettings message. Does not implicitly {@link google.cloud.channel.v1.RenewalSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {google.cloud.channel.v1.IRenewalSettings} message RenewalSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenewalSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRenewal != null && Object.hasOwnProperty.call(message, "enableRenewal")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRenewal); + if (message.resizeUnitCount != null && Object.hasOwnProperty.call(message, "resizeUnitCount")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.resizeUnitCount); + if (message.paymentPlan != null && Object.hasOwnProperty.call(message, "paymentPlan")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.paymentPlan); + if (message.paymentCycle != null && Object.hasOwnProperty.call(message, "paymentCycle")) + $root.google.cloud.channel.v1.Period.encode(message.paymentCycle, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RenewalSettings message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RenewalSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {google.cloud.channel.v1.IRenewalSettings} message RenewalSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenewalSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RenewalSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RenewalSettings} RenewalSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenewalSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RenewalSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableRenewal = reader.bool(); + break; + } + case 2: { + message.resizeUnitCount = reader.bool(); + break; + } + case 5: { + message.paymentPlan = reader.int32(); + break; + } + case 6: { + message.paymentCycle = $root.google.cloud.channel.v1.Period.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RenewalSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RenewalSettings} RenewalSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenewalSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RenewalSettings message. + * @function verify + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RenewalSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRenewal != null && message.hasOwnProperty("enableRenewal")) + if (typeof message.enableRenewal !== "boolean") + return "enableRenewal: boolean expected"; + if (message.resizeUnitCount != null && message.hasOwnProperty("resizeUnitCount")) + if (typeof message.resizeUnitCount !== "boolean") + return "resizeUnitCount: boolean expected"; + if (message.paymentPlan != null && message.hasOwnProperty("paymentPlan")) + switch (message.paymentPlan) { + default: + return "paymentPlan: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.paymentCycle != null && message.hasOwnProperty("paymentCycle")) { + var error = $root.google.cloud.channel.v1.Period.verify(message.paymentCycle); + if (error) + return "paymentCycle." + error; + } + return null; + }; + + /** + * Creates a RenewalSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RenewalSettings} RenewalSettings + */ + RenewalSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RenewalSettings) + return object; + var message = new $root.google.cloud.channel.v1.RenewalSettings(); + if (object.enableRenewal != null) + message.enableRenewal = Boolean(object.enableRenewal); + if (object.resizeUnitCount != null) + message.resizeUnitCount = Boolean(object.resizeUnitCount); + switch (object.paymentPlan) { + default: + if (typeof object.paymentPlan === "number") { + message.paymentPlan = object.paymentPlan; + break; + } + break; + case "PAYMENT_PLAN_UNSPECIFIED": + case 0: + message.paymentPlan = 0; + break; + case "COMMITMENT": + case 1: + message.paymentPlan = 1; + break; + case "FLEXIBLE": + case 2: + message.paymentPlan = 2; + break; + case "FREE": + case 3: + message.paymentPlan = 3; + break; + case "TRIAL": + case 4: + message.paymentPlan = 4; + break; + case "OFFLINE": + case 5: + message.paymentPlan = 5; + break; + } + if (object.paymentCycle != null) { + if (typeof object.paymentCycle !== "object") + throw TypeError(".google.cloud.channel.v1.RenewalSettings.paymentCycle: object expected"); + message.paymentCycle = $root.google.cloud.channel.v1.Period.fromObject(object.paymentCycle); + } + return message; + }; + + /** + * Creates a plain object from a RenewalSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {google.cloud.channel.v1.RenewalSettings} message RenewalSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RenewalSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableRenewal = false; + object.resizeUnitCount = false; + object.paymentPlan = options.enums === String ? "PAYMENT_PLAN_UNSPECIFIED" : 0; + object.paymentCycle = null; + } + if (message.enableRenewal != null && message.hasOwnProperty("enableRenewal")) + object.enableRenewal = message.enableRenewal; + if (message.resizeUnitCount != null && message.hasOwnProperty("resizeUnitCount")) + object.resizeUnitCount = message.resizeUnitCount; + if (message.paymentPlan != null && message.hasOwnProperty("paymentPlan")) + object.paymentPlan = options.enums === String ? $root.google.cloud.channel.v1.PaymentPlan[message.paymentPlan] === undefined ? message.paymentPlan : $root.google.cloud.channel.v1.PaymentPlan[message.paymentPlan] : message.paymentPlan; + if (message.paymentCycle != null && message.hasOwnProperty("paymentCycle")) + object.paymentCycle = $root.google.cloud.channel.v1.Period.toObject(message.paymentCycle, options); + return object; + }; + + /** + * Converts this RenewalSettings to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RenewalSettings + * @instance + * @returns {Object.} JSON object + */ + RenewalSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RenewalSettings + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RenewalSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RenewalSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RenewalSettings"; + }; + + return RenewalSettings; + })(); + + v1.TrialSettings = (function() { + + /** + * Properties of a TrialSettings. + * @memberof google.cloud.channel.v1 + * @interface ITrialSettings + * @property {boolean|null} [trial] TrialSettings trial + * @property {google.protobuf.ITimestamp|null} [endTime] TrialSettings endTime + */ + + /** + * Constructs a new TrialSettings. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TrialSettings. + * @implements ITrialSettings + * @constructor + * @param {google.cloud.channel.v1.ITrialSettings=} [properties] Properties to set + */ + function TrialSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialSettings trial. + * @member {boolean} trial + * @memberof google.cloud.channel.v1.TrialSettings + * @instance + */ + TrialSettings.prototype.trial = false; + + /** + * TrialSettings endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.channel.v1.TrialSettings + * @instance + */ + TrialSettings.prototype.endTime = null; + + /** + * Creates a new TrialSettings instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {google.cloud.channel.v1.ITrialSettings=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TrialSettings} TrialSettings instance + */ + TrialSettings.create = function create(properties) { + return new TrialSettings(properties); + }; + + /** + * Encodes the specified TrialSettings message. Does not implicitly {@link google.cloud.channel.v1.TrialSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {google.cloud.channel.v1.ITrialSettings} message TrialSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trial != null && Object.hasOwnProperty.call(message, "trial")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.trial); + 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(); + return writer; + }; + + /** + * Encodes the specified TrialSettings message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TrialSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {google.cloud.channel.v1.ITrialSettings} message TrialSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TrialSettings} TrialSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TrialSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.trial = reader.bool(); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TrialSettings} TrialSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialSettings message. + * @function verify + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trial != null && message.hasOwnProperty("trial")) + if (typeof message.trial !== "boolean") + return "trial: boolean expected"; + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TrialSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TrialSettings} TrialSettings + */ + TrialSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TrialSettings) + return object; + var message = new $root.google.cloud.channel.v1.TrialSettings(); + if (object.trial != null) + message.trial = Boolean(object.trial); + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.channel.v1.TrialSettings.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TrialSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {google.cloud.channel.v1.TrialSettings} message TrialSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trial = false; + object.endTime = null; + } + if (message.trial != null && message.hasOwnProperty("trial")) + object.trial = message.trial; + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TrialSettings to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TrialSettings + * @instance + * @returns {Object.} JSON object + */ + TrialSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialSettings + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TrialSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TrialSettings"; + }; + + return TrialSettings; + })(); + + v1.TransferableSku = (function() { + + /** + * Properties of a TransferableSku. + * @memberof google.cloud.channel.v1 + * @interface ITransferableSku + * @property {google.cloud.channel.v1.ITransferEligibility|null} [transferEligibility] TransferableSku transferEligibility + * @property {google.cloud.channel.v1.ISku|null} [sku] TransferableSku sku + * @property {google.cloud.channel.v1.ISku|null} [legacySku] TransferableSku legacySku + */ + + /** + * Constructs a new TransferableSku. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TransferableSku. + * @implements ITransferableSku + * @constructor + * @param {google.cloud.channel.v1.ITransferableSku=} [properties] Properties to set + */ + function TransferableSku(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferableSku transferEligibility. + * @member {google.cloud.channel.v1.ITransferEligibility|null|undefined} transferEligibility + * @memberof google.cloud.channel.v1.TransferableSku + * @instance + */ + TransferableSku.prototype.transferEligibility = null; + + /** + * TransferableSku sku. + * @member {google.cloud.channel.v1.ISku|null|undefined} sku + * @memberof google.cloud.channel.v1.TransferableSku + * @instance + */ + TransferableSku.prototype.sku = null; + + /** + * TransferableSku legacySku. + * @member {google.cloud.channel.v1.ISku|null|undefined} legacySku + * @memberof google.cloud.channel.v1.TransferableSku + * @instance + */ + TransferableSku.prototype.legacySku = null; + + /** + * Creates a new TransferableSku instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {google.cloud.channel.v1.ITransferableSku=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TransferableSku} TransferableSku instance + */ + TransferableSku.create = function create(properties) { + return new TransferableSku(properties); + }; + + /** + * Encodes the specified TransferableSku message. Does not implicitly {@link google.cloud.channel.v1.TransferableSku.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {google.cloud.channel.v1.ITransferableSku} message TransferableSku message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferableSku.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferEligibility != null && Object.hasOwnProperty.call(message, "transferEligibility")) + $root.google.cloud.channel.v1.TransferEligibility.encode(message.transferEligibility, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.sku != null && Object.hasOwnProperty.call(message, "sku")) + $root.google.cloud.channel.v1.Sku.encode(message.sku, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.legacySku != null && Object.hasOwnProperty.call(message, "legacySku")) + $root.google.cloud.channel.v1.Sku.encode(message.legacySku, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferableSku message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferableSku.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {google.cloud.channel.v1.ITransferableSku} message TransferableSku message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferableSku.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferableSku message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TransferableSku} TransferableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferableSku.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TransferableSku(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: { + message.transferEligibility = $root.google.cloud.channel.v1.TransferEligibility.decode(reader, reader.uint32()); + break; + } + case 11: { + message.sku = $root.google.cloud.channel.v1.Sku.decode(reader, reader.uint32()); + break; + } + case 12: { + message.legacySku = $root.google.cloud.channel.v1.Sku.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferableSku message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TransferableSku} TransferableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferableSku.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferableSku message. + * @function verify + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferableSku.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferEligibility != null && message.hasOwnProperty("transferEligibility")) { + var error = $root.google.cloud.channel.v1.TransferEligibility.verify(message.transferEligibility); + if (error) + return "transferEligibility." + error; + } + if (message.sku != null && message.hasOwnProperty("sku")) { + var error = $root.google.cloud.channel.v1.Sku.verify(message.sku); + if (error) + return "sku." + error; + } + if (message.legacySku != null && message.hasOwnProperty("legacySku")) { + var error = $root.google.cloud.channel.v1.Sku.verify(message.legacySku); + if (error) + return "legacySku." + error; + } + return null; + }; + + /** + * Creates a TransferableSku message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TransferableSku} TransferableSku + */ + TransferableSku.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TransferableSku) + return object; + var message = new $root.google.cloud.channel.v1.TransferableSku(); + if (object.transferEligibility != null) { + if (typeof object.transferEligibility !== "object") + throw TypeError(".google.cloud.channel.v1.TransferableSku.transferEligibility: object expected"); + message.transferEligibility = $root.google.cloud.channel.v1.TransferEligibility.fromObject(object.transferEligibility); + } + if (object.sku != null) { + if (typeof object.sku !== "object") + throw TypeError(".google.cloud.channel.v1.TransferableSku.sku: object expected"); + message.sku = $root.google.cloud.channel.v1.Sku.fromObject(object.sku); + } + if (object.legacySku != null) { + if (typeof object.legacySku !== "object") + throw TypeError(".google.cloud.channel.v1.TransferableSku.legacySku: object expected"); + message.legacySku = $root.google.cloud.channel.v1.Sku.fromObject(object.legacySku); + } + return message; + }; + + /** + * Creates a plain object from a TransferableSku message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {google.cloud.channel.v1.TransferableSku} message TransferableSku + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferableSku.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.transferEligibility = null; + object.sku = null; + object.legacySku = null; + } + if (message.transferEligibility != null && message.hasOwnProperty("transferEligibility")) + object.transferEligibility = $root.google.cloud.channel.v1.TransferEligibility.toObject(message.transferEligibility, options); + if (message.sku != null && message.hasOwnProperty("sku")) + object.sku = $root.google.cloud.channel.v1.Sku.toObject(message.sku, options); + if (message.legacySku != null && message.hasOwnProperty("legacySku")) + object.legacySku = $root.google.cloud.channel.v1.Sku.toObject(message.legacySku, options); + return object; + }; + + /** + * Converts this TransferableSku to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TransferableSku + * @instance + * @returns {Object.} JSON object + */ + TransferableSku.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferableSku + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TransferableSku + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferableSku.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TransferableSku"; + }; + + return TransferableSku; + })(); + + v1.TransferEligibility = (function() { + + /** + * Properties of a TransferEligibility. + * @memberof google.cloud.channel.v1 + * @interface ITransferEligibility + * @property {boolean|null} [isEligible] TransferEligibility isEligible + * @property {string|null} [description] TransferEligibility description + * @property {google.cloud.channel.v1.TransferEligibility.Reason|null} [ineligibilityReason] TransferEligibility ineligibilityReason + */ + + /** + * Constructs a new TransferEligibility. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TransferEligibility. + * @implements ITransferEligibility + * @constructor + * @param {google.cloud.channel.v1.ITransferEligibility=} [properties] Properties to set + */ + function TransferEligibility(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferEligibility isEligible. + * @member {boolean} isEligible + * @memberof google.cloud.channel.v1.TransferEligibility + * @instance + */ + TransferEligibility.prototype.isEligible = false; + + /** + * TransferEligibility description. + * @member {string} description + * @memberof google.cloud.channel.v1.TransferEligibility + * @instance + */ + TransferEligibility.prototype.description = ""; + + /** + * TransferEligibility ineligibilityReason. + * @member {google.cloud.channel.v1.TransferEligibility.Reason} ineligibilityReason + * @memberof google.cloud.channel.v1.TransferEligibility + * @instance + */ + TransferEligibility.prototype.ineligibilityReason = 0; + + /** + * Creates a new TransferEligibility instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {google.cloud.channel.v1.ITransferEligibility=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TransferEligibility} TransferEligibility instance + */ + TransferEligibility.create = function create(properties) { + return new TransferEligibility(properties); + }; + + /** + * Encodes the specified TransferEligibility message. Does not implicitly {@link google.cloud.channel.v1.TransferEligibility.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {google.cloud.channel.v1.ITransferEligibility} message TransferEligibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEligibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isEligible != null && Object.hasOwnProperty.call(message, "isEligible")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isEligible); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.ineligibilityReason != null && Object.hasOwnProperty.call(message, "ineligibilityReason")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ineligibilityReason); + return writer; + }; + + /** + * Encodes the specified TransferEligibility message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEligibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {google.cloud.channel.v1.ITransferEligibility} message TransferEligibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEligibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferEligibility message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TransferEligibility} TransferEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEligibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TransferEligibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.isEligible = reader.bool(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.ineligibilityReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferEligibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TransferEligibility} TransferEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEligibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferEligibility message. + * @function verify + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferEligibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isEligible != null && message.hasOwnProperty("isEligible")) + if (typeof message.isEligible !== "boolean") + return "isEligible: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.ineligibilityReason != null && message.hasOwnProperty("ineligibilityReason")) + switch (message.ineligibilityReason) { + default: + return "ineligibilityReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a TransferEligibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TransferEligibility} TransferEligibility + */ + TransferEligibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TransferEligibility) + return object; + var message = new $root.google.cloud.channel.v1.TransferEligibility(); + if (object.isEligible != null) + message.isEligible = Boolean(object.isEligible); + if (object.description != null) + message.description = String(object.description); + switch (object.ineligibilityReason) { + default: + if (typeof object.ineligibilityReason === "number") { + message.ineligibilityReason = object.ineligibilityReason; + break; + } + break; + case "REASON_UNSPECIFIED": + case 0: + message.ineligibilityReason = 0; + break; + case "PENDING_TOS_ACCEPTANCE": + case 1: + message.ineligibilityReason = 1; + break; + case "SKU_NOT_ELIGIBLE": + case 2: + message.ineligibilityReason = 2; + break; + case "SKU_SUSPENDED": + case 3: + message.ineligibilityReason = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransferEligibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {google.cloud.channel.v1.TransferEligibility} message TransferEligibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferEligibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.isEligible = false; + object.description = ""; + object.ineligibilityReason = options.enums === String ? "REASON_UNSPECIFIED" : 0; + } + if (message.isEligible != null && message.hasOwnProperty("isEligible")) + object.isEligible = message.isEligible; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.ineligibilityReason != null && message.hasOwnProperty("ineligibilityReason")) + object.ineligibilityReason = options.enums === String ? $root.google.cloud.channel.v1.TransferEligibility.Reason[message.ineligibilityReason] === undefined ? message.ineligibilityReason : $root.google.cloud.channel.v1.TransferEligibility.Reason[message.ineligibilityReason] : message.ineligibilityReason; + return object; + }; + + /** + * Converts this TransferEligibility to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TransferEligibility + * @instance + * @returns {Object.} JSON object + */ + TransferEligibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferEligibility + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TransferEligibility + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferEligibility.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TransferEligibility"; + }; + + /** + * Reason enum. + * @name google.cloud.channel.v1.TransferEligibility.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} PENDING_TOS_ACCEPTANCE=1 PENDING_TOS_ACCEPTANCE value + * @property {number} SKU_NOT_ELIGIBLE=2 SKU_NOT_ELIGIBLE value + * @property {number} SKU_SUSPENDED=3 SKU_SUSPENDED value + */ + TransferEligibility.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_TOS_ACCEPTANCE"] = 1; + values[valuesById[2] = "SKU_NOT_ELIGIBLE"] = 2; + values[valuesById[3] = "SKU_SUSPENDED"] = 3; + return values; + })(); + + return TransferEligibility; + })(); + + /** + * PromotionalOrderType enum. + * @name google.cloud.channel.v1.PromotionalOrderType + * @enum {number} + * @property {number} PROMOTIONAL_TYPE_UNSPECIFIED=0 PROMOTIONAL_TYPE_UNSPECIFIED value + * @property {number} NEW_UPGRADE=1 NEW_UPGRADE value + * @property {number} TRANSFER=2 TRANSFER value + * @property {number} PROMOTION_SWITCH=3 PROMOTION_SWITCH value + */ + v1.PromotionalOrderType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROMOTIONAL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW_UPGRADE"] = 1; + values[valuesById[2] = "TRANSFER"] = 2; + values[valuesById[3] = "PROMOTION_SWITCH"] = 3; + return values; + })(); + + /** + * PaymentPlan enum. + * @name google.cloud.channel.v1.PaymentPlan + * @enum {number} + * @property {number} PAYMENT_PLAN_UNSPECIFIED=0 PAYMENT_PLAN_UNSPECIFIED value + * @property {number} COMMITMENT=1 COMMITMENT value + * @property {number} FLEXIBLE=2 FLEXIBLE value + * @property {number} FREE=3 FREE value + * @property {number} TRIAL=4 TRIAL value + * @property {number} OFFLINE=5 OFFLINE value + */ + v1.PaymentPlan = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAYMENT_PLAN_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMMITMENT"] = 1; + values[valuesById[2] = "FLEXIBLE"] = 2; + values[valuesById[3] = "FREE"] = 3; + values[valuesById[4] = "TRIAL"] = 4; + values[valuesById[5] = "OFFLINE"] = 5; + return values; + })(); + + /** + * PaymentType enum. + * @name google.cloud.channel.v1.PaymentType + * @enum {number} + * @property {number} PAYMENT_TYPE_UNSPECIFIED=0 PAYMENT_TYPE_UNSPECIFIED value + * @property {number} PREPAY=1 PREPAY value + * @property {number} POSTPAY=2 POSTPAY value + */ + v1.PaymentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PAYMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREPAY"] = 1; + values[valuesById[2] = "POSTPAY"] = 2; + return values; + })(); + + /** + * ResourceType enum. + * @name google.cloud.channel.v1.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} SEAT=1 SEAT value + * @property {number} MAU=2 MAU value + * @property {number} GB=3 GB value + * @property {number} LICENSED_USER=4 LICENSED_USER value + * @property {number} MINUTES=5 MINUTES value + * @property {number} IAAS_USAGE=6 IAAS_USAGE value + * @property {number} SUBSCRIPTION=7 SUBSCRIPTION value + */ + v1.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEAT"] = 1; + values[valuesById[2] = "MAU"] = 2; + values[valuesById[3] = "GB"] = 3; + values[valuesById[4] = "LICENSED_USER"] = 4; + values[valuesById[5] = "MINUTES"] = 5; + values[valuesById[6] = "IAAS_USAGE"] = 6; + values[valuesById[7] = "SUBSCRIPTION"] = 7; + return values; + })(); + + /** + * PeriodType enum. + * @name google.cloud.channel.v1.PeriodType + * @enum {number} + * @property {number} PERIOD_TYPE_UNSPECIFIED=0 PERIOD_TYPE_UNSPECIFIED value + * @property {number} DAY=1 DAY value + * @property {number} MONTH=2 MONTH value + * @property {number} YEAR=3 YEAR value + */ + v1.PeriodType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIOD_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DAY"] = 1; + values[valuesById[2] = "MONTH"] = 2; + values[valuesById[3] = "YEAR"] = 3; + return values; + })(); + + v1.Offer = (function() { + + /** + * Properties of an Offer. + * @memberof google.cloud.channel.v1 + * @interface IOffer + * @property {string|null} [name] Offer name + * @property {google.cloud.channel.v1.IMarketingInfo|null} [marketingInfo] Offer marketingInfo + * @property {google.cloud.channel.v1.ISku|null} [sku] Offer sku + * @property {google.cloud.channel.v1.IPlan|null} [plan] Offer plan + * @property {google.cloud.channel.v1.IConstraints|null} [constraints] Offer constraints + * @property {Array.|null} [priceByResources] Offer priceByResources + * @property {google.protobuf.ITimestamp|null} [startTime] Offer startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Offer endTime + * @property {Array.|null} [parameterDefinitions] Offer parameterDefinitions + * @property {string|null} [dealCode] Offer dealCode + */ + + /** + * Constructs a new Offer. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an Offer. + * @implements IOffer + * @constructor + * @param {google.cloud.channel.v1.IOffer=} [properties] Properties to set + */ + function Offer(properties) { + this.priceByResources = []; + this.parameterDefinitions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Offer name. + * @member {string} name + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.name = ""; + + /** + * Offer marketingInfo. + * @member {google.cloud.channel.v1.IMarketingInfo|null|undefined} marketingInfo + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.marketingInfo = null; + + /** + * Offer sku. + * @member {google.cloud.channel.v1.ISku|null|undefined} sku + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.sku = null; + + /** + * Offer plan. + * @member {google.cloud.channel.v1.IPlan|null|undefined} plan + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.plan = null; + + /** + * Offer constraints. + * @member {google.cloud.channel.v1.IConstraints|null|undefined} constraints + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.constraints = null; + + /** + * Offer priceByResources. + * @member {Array.} priceByResources + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.priceByResources = $util.emptyArray; + + /** + * Offer startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.startTime = null; + + /** + * Offer endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.endTime = null; + + /** + * Offer parameterDefinitions. + * @member {Array.} parameterDefinitions + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.parameterDefinitions = $util.emptyArray; + + /** + * Offer dealCode. + * @member {string} dealCode + * @memberof google.cloud.channel.v1.Offer + * @instance + */ + Offer.prototype.dealCode = ""; + + /** + * Creates a new Offer instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {google.cloud.channel.v1.IOffer=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Offer} Offer instance + */ + Offer.create = function create(properties) { + return new Offer(properties); + }; + + /** + * Encodes the specified Offer message. Does not implicitly {@link google.cloud.channel.v1.Offer.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {google.cloud.channel.v1.IOffer} message Offer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Offer.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.marketingInfo != null && Object.hasOwnProperty.call(message, "marketingInfo")) + $root.google.cloud.channel.v1.MarketingInfo.encode(message.marketingInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sku != null && Object.hasOwnProperty.call(message, "sku")) + $root.google.cloud.channel.v1.Sku.encode(message.sku, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) + $root.google.cloud.channel.v1.Plan.encode(message.plan, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.constraints != null && Object.hasOwnProperty.call(message, "constraints")) + $root.google.cloud.channel.v1.Constraints.encode(message.constraints, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.priceByResources != null && message.priceByResources.length) + for (var i = 0; i < message.priceByResources.length; ++i) + $root.google.cloud.channel.v1.PriceByResource.encode(message.priceByResources[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.parameterDefinitions != null && message.parameterDefinitions.length) + for (var i = 0; i < message.parameterDefinitions.length; ++i) + $root.google.cloud.channel.v1.ParameterDefinition.encode(message.parameterDefinitions[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dealCode != null && Object.hasOwnProperty.call(message, "dealCode")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.dealCode); + return writer; + }; + + /** + * Encodes the specified Offer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Offer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {google.cloud.channel.v1.IOffer} message Offer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Offer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Offer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Offer} Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Offer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Offer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sku = $root.google.cloud.channel.v1.Sku.decode(reader, reader.uint32()); + break; + } + case 4: { + message.plan = $root.google.cloud.channel.v1.Plan.decode(reader, reader.uint32()); + break; + } + case 5: { + message.constraints = $root.google.cloud.channel.v1.Constraints.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.priceByResources && message.priceByResources.length)) + message.priceByResources = []; + message.priceByResources.push($root.google.cloud.channel.v1.PriceByResource.decode(reader, reader.uint32())); + break; + } + case 7: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.parameterDefinitions && message.parameterDefinitions.length)) + message.parameterDefinitions = []; + message.parameterDefinitions.push($root.google.cloud.channel.v1.ParameterDefinition.decode(reader, reader.uint32())); + break; + } + case 12: { + message.dealCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Offer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Offer} Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Offer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Offer message. + * @function verify + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Offer.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.marketingInfo != null && message.hasOwnProperty("marketingInfo")) { + var error = $root.google.cloud.channel.v1.MarketingInfo.verify(message.marketingInfo); + if (error) + return "marketingInfo." + error; + } + if (message.sku != null && message.hasOwnProperty("sku")) { + var error = $root.google.cloud.channel.v1.Sku.verify(message.sku); + if (error) + return "sku." + error; + } + if (message.plan != null && message.hasOwnProperty("plan")) { + var error = $root.google.cloud.channel.v1.Plan.verify(message.plan); + if (error) + return "plan." + error; + } + if (message.constraints != null && message.hasOwnProperty("constraints")) { + var error = $root.google.cloud.channel.v1.Constraints.verify(message.constraints); + if (error) + return "constraints." + error; + } + if (message.priceByResources != null && message.hasOwnProperty("priceByResources")) { + if (!Array.isArray(message.priceByResources)) + return "priceByResources: array expected"; + for (var i = 0; i < message.priceByResources.length; ++i) { + var error = $root.google.cloud.channel.v1.PriceByResource.verify(message.priceByResources[i]); + if (error) + return "priceByResources." + error; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.parameterDefinitions != null && message.hasOwnProperty("parameterDefinitions")) { + if (!Array.isArray(message.parameterDefinitions)) + return "parameterDefinitions: array expected"; + for (var i = 0; i < message.parameterDefinitions.length; ++i) { + var error = $root.google.cloud.channel.v1.ParameterDefinition.verify(message.parameterDefinitions[i]); + if (error) + return "parameterDefinitions." + error; + } + } + if (message.dealCode != null && message.hasOwnProperty("dealCode")) + if (!$util.isString(message.dealCode)) + return "dealCode: string expected"; + return null; + }; + + /** + * Creates an Offer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Offer} Offer + */ + Offer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Offer) + return object; + var message = new $root.google.cloud.channel.v1.Offer(); + if (object.name != null) + message.name = String(object.name); + if (object.marketingInfo != null) { + if (typeof object.marketingInfo !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.marketingInfo: object expected"); + message.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.fromObject(object.marketingInfo); + } + if (object.sku != null) { + if (typeof object.sku !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.sku: object expected"); + message.sku = $root.google.cloud.channel.v1.Sku.fromObject(object.sku); + } + if (object.plan != null) { + if (typeof object.plan !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.plan: object expected"); + message.plan = $root.google.cloud.channel.v1.Plan.fromObject(object.plan); + } + if (object.constraints != null) { + if (typeof object.constraints !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.constraints: object expected"); + message.constraints = $root.google.cloud.channel.v1.Constraints.fromObject(object.constraints); + } + if (object.priceByResources) { + if (!Array.isArray(object.priceByResources)) + throw TypeError(".google.cloud.channel.v1.Offer.priceByResources: array expected"); + message.priceByResources = []; + for (var i = 0; i < object.priceByResources.length; ++i) { + if (typeof object.priceByResources[i] !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.priceByResources: object expected"); + message.priceByResources[i] = $root.google.cloud.channel.v1.PriceByResource.fromObject(object.priceByResources[i]); + } + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.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.channel.v1.Offer.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.parameterDefinitions) { + if (!Array.isArray(object.parameterDefinitions)) + throw TypeError(".google.cloud.channel.v1.Offer.parameterDefinitions: array expected"); + message.parameterDefinitions = []; + for (var i = 0; i < object.parameterDefinitions.length; ++i) { + if (typeof object.parameterDefinitions[i] !== "object") + throw TypeError(".google.cloud.channel.v1.Offer.parameterDefinitions: object expected"); + message.parameterDefinitions[i] = $root.google.cloud.channel.v1.ParameterDefinition.fromObject(object.parameterDefinitions[i]); + } + } + if (object.dealCode != null) + message.dealCode = String(object.dealCode); + return message; + }; + + /** + * Creates a plain object from an Offer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {google.cloud.channel.v1.Offer} message Offer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Offer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.priceByResources = []; + object.parameterDefinitions = []; + } + if (options.defaults) { + object.name = ""; + object.marketingInfo = null; + object.sku = null; + object.plan = null; + object.constraints = null; + object.startTime = null; + object.endTime = null; + object.dealCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.marketingInfo != null && message.hasOwnProperty("marketingInfo")) + object.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.toObject(message.marketingInfo, options); + if (message.sku != null && message.hasOwnProperty("sku")) + object.sku = $root.google.cloud.channel.v1.Sku.toObject(message.sku, options); + if (message.plan != null && message.hasOwnProperty("plan")) + object.plan = $root.google.cloud.channel.v1.Plan.toObject(message.plan, options); + if (message.constraints != null && message.hasOwnProperty("constraints")) + object.constraints = $root.google.cloud.channel.v1.Constraints.toObject(message.constraints, options); + if (message.priceByResources && message.priceByResources.length) { + object.priceByResources = []; + for (var j = 0; j < message.priceByResources.length; ++j) + object.priceByResources[j] = $root.google.cloud.channel.v1.PriceByResource.toObject(message.priceByResources[j], options); + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.parameterDefinitions && message.parameterDefinitions.length) { + object.parameterDefinitions = []; + for (var j = 0; j < message.parameterDefinitions.length; ++j) + object.parameterDefinitions[j] = $root.google.cloud.channel.v1.ParameterDefinition.toObject(message.parameterDefinitions[j], options); + } + if (message.dealCode != null && message.hasOwnProperty("dealCode")) + object.dealCode = message.dealCode; + return object; + }; + + /** + * Converts this Offer to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Offer + * @instance + * @returns {Object.} JSON object + */ + Offer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Offer + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Offer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Offer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Offer"; + }; + + return Offer; + })(); + + v1.ParameterDefinition = (function() { + + /** + * Properties of a ParameterDefinition. + * @memberof google.cloud.channel.v1 + * @interface IParameterDefinition + * @property {string|null} [name] ParameterDefinition name + * @property {google.cloud.channel.v1.ParameterDefinition.ParameterType|null} [parameterType] ParameterDefinition parameterType + * @property {google.cloud.channel.v1.IValue|null} [minValue] ParameterDefinition minValue + * @property {google.cloud.channel.v1.IValue|null} [maxValue] ParameterDefinition maxValue + * @property {Array.|null} [allowedValues] ParameterDefinition allowedValues + * @property {boolean|null} [optional] ParameterDefinition optional + */ + + /** + * Constructs a new ParameterDefinition. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ParameterDefinition. + * @implements IParameterDefinition + * @constructor + * @param {google.cloud.channel.v1.IParameterDefinition=} [properties] Properties to set + */ + function ParameterDefinition(properties) { + this.allowedValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterDefinition name. + * @member {string} name + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.name = ""; + + /** + * ParameterDefinition parameterType. + * @member {google.cloud.channel.v1.ParameterDefinition.ParameterType} parameterType + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.parameterType = 0; + + /** + * ParameterDefinition minValue. + * @member {google.cloud.channel.v1.IValue|null|undefined} minValue + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.minValue = null; + + /** + * ParameterDefinition maxValue. + * @member {google.cloud.channel.v1.IValue|null|undefined} maxValue + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.maxValue = null; + + /** + * ParameterDefinition allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.allowedValues = $util.emptyArray; + + /** + * ParameterDefinition optional. + * @member {boolean} optional + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + */ + ParameterDefinition.prototype.optional = false; + + /** + * Creates a new ParameterDefinition instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {google.cloud.channel.v1.IParameterDefinition=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ParameterDefinition} ParameterDefinition instance + */ + ParameterDefinition.create = function create(properties) { + return new ParameterDefinition(properties); + }; + + /** + * Encodes the specified ParameterDefinition message. Does not implicitly {@link google.cloud.channel.v1.ParameterDefinition.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {google.cloud.channel.v1.IParameterDefinition} message ParameterDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterDefinition.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.parameterType != null && Object.hasOwnProperty.call(message, "parameterType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.parameterType); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + $root.google.cloud.channel.v1.Value.encode(message.minValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + $root.google.cloud.channel.v1.Value.encode(message.maxValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + $root.google.cloud.channel.v1.Value.encode(message.allowedValues[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.optional != null && Object.hasOwnProperty.call(message, "optional")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.optional); + return writer; + }; + + /** + * Encodes the specified ParameterDefinition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ParameterDefinition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {google.cloud.channel.v1.IParameterDefinition} message ParameterDefinition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterDefinition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ParameterDefinition} ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterDefinition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ParameterDefinition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parameterType = reader.int32(); + break; + } + case 3: { + message.minValue = $root.google.cloud.channel.v1.Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.maxValue = $root.google.cloud.channel.v1.Value.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push($root.google.cloud.channel.v1.Value.decode(reader, reader.uint32())); + break; + } + case 6: { + message.optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterDefinition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ParameterDefinition} ParameterDefinition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterDefinition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterDefinition message. + * @function verify + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterDefinition.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.parameterType != null && message.hasOwnProperty("parameterType")) + switch (message.parameterType) { + default: + return "parameterType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.minValue != null && message.hasOwnProperty("minValue")) { + var error = $root.google.cloud.channel.v1.Value.verify(message.minValue); + if (error) + return "minValue." + error; + } + if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + var error = $root.google.cloud.channel.v1.Value.verify(message.maxValue); + if (error) + return "maxValue." + error; + } + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) { + var error = $root.google.cloud.channel.v1.Value.verify(message.allowedValues[i]); + if (error) + return "allowedValues." + error; + } + } + if (message.optional != null && message.hasOwnProperty("optional")) + if (typeof message.optional !== "boolean") + return "optional: boolean expected"; + return null; + }; + + /** + * Creates a ParameterDefinition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ParameterDefinition} ParameterDefinition + */ + ParameterDefinition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ParameterDefinition) + return object; + var message = new $root.google.cloud.channel.v1.ParameterDefinition(); + if (object.name != null) + message.name = String(object.name); + switch (object.parameterType) { + default: + if (typeof object.parameterType === "number") { + message.parameterType = object.parameterType; + break; + } + break; + case "PARAMETER_TYPE_UNSPECIFIED": + case 0: + message.parameterType = 0; + break; + case "INT64": + case 1: + message.parameterType = 1; + break; + case "STRING": + case 2: + message.parameterType = 2; + break; + case "DOUBLE": + case 3: + message.parameterType = 3; + break; + } + if (object.minValue != null) { + if (typeof object.minValue !== "object") + throw TypeError(".google.cloud.channel.v1.ParameterDefinition.minValue: object expected"); + message.minValue = $root.google.cloud.channel.v1.Value.fromObject(object.minValue); + } + if (object.maxValue != null) { + if (typeof object.maxValue !== "object") + throw TypeError(".google.cloud.channel.v1.ParameterDefinition.maxValue: object expected"); + message.maxValue = $root.google.cloud.channel.v1.Value.fromObject(object.maxValue); + } + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.channel.v1.ParameterDefinition.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) { + if (typeof object.allowedValues[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ParameterDefinition.allowedValues: object expected"); + message.allowedValues[i] = $root.google.cloud.channel.v1.Value.fromObject(object.allowedValues[i]); + } + } + if (object.optional != null) + message.optional = Boolean(object.optional); + return message; + }; + + /** + * Creates a plain object from a ParameterDefinition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {google.cloud.channel.v1.ParameterDefinition} message ParameterDefinition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterDefinition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedValues = []; + if (options.defaults) { + object.name = ""; + object.parameterType = options.enums === String ? "PARAMETER_TYPE_UNSPECIFIED" : 0; + object.minValue = null; + object.maxValue = null; + object.optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parameterType != null && message.hasOwnProperty("parameterType")) + object.parameterType = options.enums === String ? $root.google.cloud.channel.v1.ParameterDefinition.ParameterType[message.parameterType] === undefined ? message.parameterType : $root.google.cloud.channel.v1.ParameterDefinition.ParameterType[message.parameterType] : message.parameterType; + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = $root.google.cloud.channel.v1.Value.toObject(message.minValue, options); + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = $root.google.cloud.channel.v1.Value.toObject(message.maxValue, options); + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = $root.google.cloud.channel.v1.Value.toObject(message.allowedValues[j], options); + } + if (message.optional != null && message.hasOwnProperty("optional")) + object.optional = message.optional; + return object; + }; + + /** + * Converts this ParameterDefinition to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ParameterDefinition + * @instance + * @returns {Object.} JSON object + */ + ParameterDefinition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterDefinition + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ParameterDefinition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ParameterDefinition"; + }; + + /** + * ParameterType enum. + * @name google.cloud.channel.v1.ParameterDefinition.ParameterType + * @enum {number} + * @property {number} PARAMETER_TYPE_UNSPECIFIED=0 PARAMETER_TYPE_UNSPECIFIED value + * @property {number} INT64=1 INT64 value + * @property {number} STRING=2 STRING value + * @property {number} DOUBLE=3 DOUBLE value + */ + ParameterDefinition.ParameterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARAMETER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INT64"] = 1; + values[valuesById[2] = "STRING"] = 2; + values[valuesById[3] = "DOUBLE"] = 3; + return values; + })(); + + return ParameterDefinition; + })(); + + v1.Constraints = (function() { + + /** + * Properties of a Constraints. + * @memberof google.cloud.channel.v1 + * @interface IConstraints + * @property {google.cloud.channel.v1.ICustomerConstraints|null} [customerConstraints] Constraints customerConstraints + */ + + /** + * Constructs a new Constraints. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Constraints. + * @implements IConstraints + * @constructor + * @param {google.cloud.channel.v1.IConstraints=} [properties] Properties to set + */ + function Constraints(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Constraints customerConstraints. + * @member {google.cloud.channel.v1.ICustomerConstraints|null|undefined} customerConstraints + * @memberof google.cloud.channel.v1.Constraints + * @instance + */ + Constraints.prototype.customerConstraints = null; + + /** + * Creates a new Constraints instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {google.cloud.channel.v1.IConstraints=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Constraints} Constraints instance + */ + Constraints.create = function create(properties) { + return new Constraints(properties); + }; + + /** + * Encodes the specified Constraints message. Does not implicitly {@link google.cloud.channel.v1.Constraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {google.cloud.channel.v1.IConstraints} message Constraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerConstraints != null && Object.hasOwnProperty.call(message, "customerConstraints")) + $root.google.cloud.channel.v1.CustomerConstraints.encode(message.customerConstraints, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Constraints message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Constraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {google.cloud.channel.v1.IConstraints} message Constraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Constraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Constraints} Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Constraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customerConstraints = $root.google.cloud.channel.v1.CustomerConstraints.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Constraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Constraints} Constraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Constraints message. + * @function verify + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Constraints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customerConstraints != null && message.hasOwnProperty("customerConstraints")) { + var error = $root.google.cloud.channel.v1.CustomerConstraints.verify(message.customerConstraints); + if (error) + return "customerConstraints." + error; + } + return null; + }; + + /** + * Creates a Constraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Constraints} Constraints + */ + Constraints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Constraints) + return object; + var message = new $root.google.cloud.channel.v1.Constraints(); + if (object.customerConstraints != null) { + if (typeof object.customerConstraints !== "object") + throw TypeError(".google.cloud.channel.v1.Constraints.customerConstraints: object expected"); + message.customerConstraints = $root.google.cloud.channel.v1.CustomerConstraints.fromObject(object.customerConstraints); + } + return message; + }; + + /** + * Creates a plain object from a Constraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {google.cloud.channel.v1.Constraints} message Constraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Constraints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customerConstraints = null; + if (message.customerConstraints != null && message.hasOwnProperty("customerConstraints")) + object.customerConstraints = $root.google.cloud.channel.v1.CustomerConstraints.toObject(message.customerConstraints, options); + return object; + }; + + /** + * Converts this Constraints to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Constraints + * @instance + * @returns {Object.} JSON object + */ + Constraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Constraints + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Constraints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Constraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Constraints"; + }; + + return Constraints; + })(); + + v1.CustomerConstraints = (function() { + + /** + * Properties of a CustomerConstraints. + * @memberof google.cloud.channel.v1 + * @interface ICustomerConstraints + * @property {Array.|null} [allowedRegions] CustomerConstraints allowedRegions + * @property {Array.|null} [allowedCustomerTypes] CustomerConstraints allowedCustomerTypes + * @property {Array.|null} [promotionalOrderTypes] CustomerConstraints promotionalOrderTypes + */ + + /** + * Constructs a new CustomerConstraints. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CustomerConstraints. + * @implements ICustomerConstraints + * @constructor + * @param {google.cloud.channel.v1.ICustomerConstraints=} [properties] Properties to set + */ + function CustomerConstraints(properties) { + this.allowedRegions = []; + this.allowedCustomerTypes = []; + this.promotionalOrderTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerConstraints allowedRegions. + * @member {Array.} allowedRegions + * @memberof google.cloud.channel.v1.CustomerConstraints + * @instance + */ + CustomerConstraints.prototype.allowedRegions = $util.emptyArray; + + /** + * CustomerConstraints allowedCustomerTypes. + * @member {Array.} allowedCustomerTypes + * @memberof google.cloud.channel.v1.CustomerConstraints + * @instance + */ + CustomerConstraints.prototype.allowedCustomerTypes = $util.emptyArray; + + /** + * CustomerConstraints promotionalOrderTypes. + * @member {Array.} promotionalOrderTypes + * @memberof google.cloud.channel.v1.CustomerConstraints + * @instance + */ + CustomerConstraints.prototype.promotionalOrderTypes = $util.emptyArray; + + /** + * Creates a new CustomerConstraints instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {google.cloud.channel.v1.ICustomerConstraints=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CustomerConstraints} CustomerConstraints instance + */ + CustomerConstraints.create = function create(properties) { + return new CustomerConstraints(properties); + }; + + /** + * Encodes the specified CustomerConstraints message. Does not implicitly {@link google.cloud.channel.v1.CustomerConstraints.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {google.cloud.channel.v1.ICustomerConstraints} message CustomerConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerConstraints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedRegions != null && message.allowedRegions.length) + for (var i = 0; i < message.allowedRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedRegions[i]); + if (message.allowedCustomerTypes != null && message.allowedCustomerTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.allowedCustomerTypes.length; ++i) + writer.int32(message.allowedCustomerTypes[i]); + writer.ldelim(); + } + if (message.promotionalOrderTypes != null && message.promotionalOrderTypes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.promotionalOrderTypes.length; ++i) + writer.int32(message.promotionalOrderTypes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CustomerConstraints message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CustomerConstraints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {google.cloud.channel.v1.ICustomerConstraints} message CustomerConstraints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerConstraints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerConstraints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CustomerConstraints} CustomerConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerConstraints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CustomerConstraints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedRegions && message.allowedRegions.length)) + message.allowedRegions = []; + message.allowedRegions.push(reader.string()); + break; + } + case 2: { + if (!(message.allowedCustomerTypes && message.allowedCustomerTypes.length)) + message.allowedCustomerTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedCustomerTypes.push(reader.int32()); + } else + message.allowedCustomerTypes.push(reader.int32()); + break; + } + case 3: { + if (!(message.promotionalOrderTypes && message.promotionalOrderTypes.length)) + message.promotionalOrderTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.promotionalOrderTypes.push(reader.int32()); + } else + message.promotionalOrderTypes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerConstraints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CustomerConstraints} CustomerConstraints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerConstraints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerConstraints message. + * @function verify + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerConstraints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedRegions != null && message.hasOwnProperty("allowedRegions")) { + if (!Array.isArray(message.allowedRegions)) + return "allowedRegions: array expected"; + for (var i = 0; i < message.allowedRegions.length; ++i) + if (!$util.isString(message.allowedRegions[i])) + return "allowedRegions: string[] expected"; + } + if (message.allowedCustomerTypes != null && message.hasOwnProperty("allowedCustomerTypes")) { + if (!Array.isArray(message.allowedCustomerTypes)) + return "allowedCustomerTypes: array expected"; + for (var i = 0; i < message.allowedCustomerTypes.length; ++i) + switch (message.allowedCustomerTypes[i]) { + default: + return "allowedCustomerTypes: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.promotionalOrderTypes != null && message.hasOwnProperty("promotionalOrderTypes")) { + if (!Array.isArray(message.promotionalOrderTypes)) + return "promotionalOrderTypes: array expected"; + for (var i = 0; i < message.promotionalOrderTypes.length; ++i) + switch (message.promotionalOrderTypes[i]) { + default: + return "promotionalOrderTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a CustomerConstraints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CustomerConstraints} CustomerConstraints + */ + CustomerConstraints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CustomerConstraints) + return object; + var message = new $root.google.cloud.channel.v1.CustomerConstraints(); + if (object.allowedRegions) { + if (!Array.isArray(object.allowedRegions)) + throw TypeError(".google.cloud.channel.v1.CustomerConstraints.allowedRegions: array expected"); + message.allowedRegions = []; + for (var i = 0; i < object.allowedRegions.length; ++i) + message.allowedRegions[i] = String(object.allowedRegions[i]); + } + if (object.allowedCustomerTypes) { + if (!Array.isArray(object.allowedCustomerTypes)) + throw TypeError(".google.cloud.channel.v1.CustomerConstraints.allowedCustomerTypes: array expected"); + message.allowedCustomerTypes = []; + for (var i = 0; i < object.allowedCustomerTypes.length; ++i) + switch (object.allowedCustomerTypes[i]) { + default: + if (typeof object.allowedCustomerTypes[i] === "number") { + message.allowedCustomerTypes[i] = object.allowedCustomerTypes[i]; + break; + } + case "CUSTOMER_TYPE_UNSPECIFIED": + case 0: + message.allowedCustomerTypes[i] = 0; + break; + case "DOMAIN": + case 1: + message.allowedCustomerTypes[i] = 1; + break; + case "TEAM": + case 2: + message.allowedCustomerTypes[i] = 2; + break; + } + } + if (object.promotionalOrderTypes) { + if (!Array.isArray(object.promotionalOrderTypes)) + throw TypeError(".google.cloud.channel.v1.CustomerConstraints.promotionalOrderTypes: array expected"); + message.promotionalOrderTypes = []; + for (var i = 0; i < object.promotionalOrderTypes.length; ++i) + switch (object.promotionalOrderTypes[i]) { + default: + if (typeof object.promotionalOrderTypes[i] === "number") { + message.promotionalOrderTypes[i] = object.promotionalOrderTypes[i]; + break; + } + case "PROMOTIONAL_TYPE_UNSPECIFIED": + case 0: + message.promotionalOrderTypes[i] = 0; + break; + case "NEW_UPGRADE": + case 1: + message.promotionalOrderTypes[i] = 1; + break; + case "TRANSFER": + case 2: + message.promotionalOrderTypes[i] = 2; + break; + case "PROMOTION_SWITCH": + case 3: + message.promotionalOrderTypes[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CustomerConstraints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {google.cloud.channel.v1.CustomerConstraints} message CustomerConstraints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerConstraints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedRegions = []; + object.allowedCustomerTypes = []; + object.promotionalOrderTypes = []; + } + if (message.allowedRegions && message.allowedRegions.length) { + object.allowedRegions = []; + for (var j = 0; j < message.allowedRegions.length; ++j) + object.allowedRegions[j] = message.allowedRegions[j]; + } + if (message.allowedCustomerTypes && message.allowedCustomerTypes.length) { + object.allowedCustomerTypes = []; + for (var j = 0; j < message.allowedCustomerTypes.length; ++j) + object.allowedCustomerTypes[j] = options.enums === String ? $root.google.cloud.channel.v1.CloudIdentityInfo.CustomerType[message.allowedCustomerTypes[j]] === undefined ? message.allowedCustomerTypes[j] : $root.google.cloud.channel.v1.CloudIdentityInfo.CustomerType[message.allowedCustomerTypes[j]] : message.allowedCustomerTypes[j]; + } + if (message.promotionalOrderTypes && message.promotionalOrderTypes.length) { + object.promotionalOrderTypes = []; + for (var j = 0; j < message.promotionalOrderTypes.length; ++j) + object.promotionalOrderTypes[j] = options.enums === String ? $root.google.cloud.channel.v1.PromotionalOrderType[message.promotionalOrderTypes[j]] === undefined ? message.promotionalOrderTypes[j] : $root.google.cloud.channel.v1.PromotionalOrderType[message.promotionalOrderTypes[j]] : message.promotionalOrderTypes[j]; + } + return object; + }; + + /** + * Converts this CustomerConstraints to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CustomerConstraints + * @instance + * @returns {Object.} JSON object + */ + CustomerConstraints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerConstraints + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CustomerConstraints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CustomerConstraints"; + }; + + return CustomerConstraints; + })(); + + v1.Plan = (function() { + + /** + * Properties of a Plan. + * @memberof google.cloud.channel.v1 + * @interface IPlan + * @property {google.cloud.channel.v1.PaymentPlan|null} [paymentPlan] Plan paymentPlan + * @property {google.cloud.channel.v1.PaymentType|null} [paymentType] Plan paymentType + * @property {google.cloud.channel.v1.IPeriod|null} [paymentCycle] Plan paymentCycle + * @property {google.cloud.channel.v1.IPeriod|null} [trialPeriod] Plan trialPeriod + * @property {string|null} [billingAccount] Plan billingAccount + */ + + /** + * Constructs a new Plan. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Plan. + * @implements IPlan + * @constructor + * @param {google.cloud.channel.v1.IPlan=} [properties] Properties to set + */ + function Plan(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Plan paymentPlan. + * @member {google.cloud.channel.v1.PaymentPlan} paymentPlan + * @memberof google.cloud.channel.v1.Plan + * @instance + */ + Plan.prototype.paymentPlan = 0; + + /** + * Plan paymentType. + * @member {google.cloud.channel.v1.PaymentType} paymentType + * @memberof google.cloud.channel.v1.Plan + * @instance + */ + Plan.prototype.paymentType = 0; + + /** + * Plan paymentCycle. + * @member {google.cloud.channel.v1.IPeriod|null|undefined} paymentCycle + * @memberof google.cloud.channel.v1.Plan + * @instance + */ + Plan.prototype.paymentCycle = null; + + /** + * Plan trialPeriod. + * @member {google.cloud.channel.v1.IPeriod|null|undefined} trialPeriod + * @memberof google.cloud.channel.v1.Plan + * @instance + */ + Plan.prototype.trialPeriod = null; + + /** + * Plan billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.channel.v1.Plan + * @instance + */ + Plan.prototype.billingAccount = ""; + + /** + * Creates a new Plan instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {google.cloud.channel.v1.IPlan=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Plan} Plan instance + */ + Plan.create = function create(properties) { + return new Plan(properties); + }; + + /** + * Encodes the specified Plan message. Does not implicitly {@link google.cloud.channel.v1.Plan.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {google.cloud.channel.v1.IPlan} message Plan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paymentPlan != null && Object.hasOwnProperty.call(message, "paymentPlan")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.paymentPlan); + if (message.paymentType != null && Object.hasOwnProperty.call(message, "paymentType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.paymentType); + if (message.paymentCycle != null && Object.hasOwnProperty.call(message, "paymentCycle")) + $root.google.cloud.channel.v1.Period.encode(message.paymentCycle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.trialPeriod != null && Object.hasOwnProperty.call(message, "trialPeriod")) + $root.google.cloud.channel.v1.Period.encode(message.trialPeriod, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.billingAccount); + return writer; + }; + + /** + * Encodes the specified Plan message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Plan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {google.cloud.channel.v1.IPlan} message Plan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Plan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Plan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Plan} Plan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Plan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.paymentPlan = reader.int32(); + break; + } + case 2: { + message.paymentType = reader.int32(); + break; + } + case 3: { + message.paymentCycle = $root.google.cloud.channel.v1.Period.decode(reader, reader.uint32()); + break; + } + case 4: { + message.trialPeriod = $root.google.cloud.channel.v1.Period.decode(reader, reader.uint32()); + break; + } + case 5: { + message.billingAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Plan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Plan} Plan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Plan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Plan message. + * @function verify + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Plan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentPlan != null && message.hasOwnProperty("paymentPlan")) + switch (message.paymentPlan) { + default: + return "paymentPlan: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.paymentType != null && message.hasOwnProperty("paymentType")) + switch (message.paymentType) { + default: + return "paymentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.paymentCycle != null && message.hasOwnProperty("paymentCycle")) { + var error = $root.google.cloud.channel.v1.Period.verify(message.paymentCycle); + if (error) + return "paymentCycle." + error; + } + if (message.trialPeriod != null && message.hasOwnProperty("trialPeriod")) { + var error = $root.google.cloud.channel.v1.Period.verify(message.trialPeriod); + if (error) + return "trialPeriod." + error; + } + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; + return null; + }; + + /** + * Creates a Plan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Plan} Plan + */ + Plan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Plan) + return object; + var message = new $root.google.cloud.channel.v1.Plan(); + switch (object.paymentPlan) { + default: + if (typeof object.paymentPlan === "number") { + message.paymentPlan = object.paymentPlan; + break; + } + break; + case "PAYMENT_PLAN_UNSPECIFIED": + case 0: + message.paymentPlan = 0; + break; + case "COMMITMENT": + case 1: + message.paymentPlan = 1; + break; + case "FLEXIBLE": + case 2: + message.paymentPlan = 2; + break; + case "FREE": + case 3: + message.paymentPlan = 3; + break; + case "TRIAL": + case 4: + message.paymentPlan = 4; + break; + case "OFFLINE": + case 5: + message.paymentPlan = 5; + break; + } + switch (object.paymentType) { + default: + if (typeof object.paymentType === "number") { + message.paymentType = object.paymentType; + break; + } + break; + case "PAYMENT_TYPE_UNSPECIFIED": + case 0: + message.paymentType = 0; + break; + case "PREPAY": + case 1: + message.paymentType = 1; + break; + case "POSTPAY": + case 2: + message.paymentType = 2; + break; + } + if (object.paymentCycle != null) { + if (typeof object.paymentCycle !== "object") + throw TypeError(".google.cloud.channel.v1.Plan.paymentCycle: object expected"); + message.paymentCycle = $root.google.cloud.channel.v1.Period.fromObject(object.paymentCycle); + } + if (object.trialPeriod != null) { + if (typeof object.trialPeriod !== "object") + throw TypeError(".google.cloud.channel.v1.Plan.trialPeriod: object expected"); + message.trialPeriod = $root.google.cloud.channel.v1.Period.fromObject(object.trialPeriod); + } + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); + return message; + }; + + /** + * Creates a plain object from a Plan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {google.cloud.channel.v1.Plan} message Plan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Plan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.paymentPlan = options.enums === String ? "PAYMENT_PLAN_UNSPECIFIED" : 0; + object.paymentType = options.enums === String ? "PAYMENT_TYPE_UNSPECIFIED" : 0; + object.paymentCycle = null; + object.trialPeriod = null; + object.billingAccount = ""; + } + if (message.paymentPlan != null && message.hasOwnProperty("paymentPlan")) + object.paymentPlan = options.enums === String ? $root.google.cloud.channel.v1.PaymentPlan[message.paymentPlan] === undefined ? message.paymentPlan : $root.google.cloud.channel.v1.PaymentPlan[message.paymentPlan] : message.paymentPlan; + if (message.paymentType != null && message.hasOwnProperty("paymentType")) + object.paymentType = options.enums === String ? $root.google.cloud.channel.v1.PaymentType[message.paymentType] === undefined ? message.paymentType : $root.google.cloud.channel.v1.PaymentType[message.paymentType] : message.paymentType; + if (message.paymentCycle != null && message.hasOwnProperty("paymentCycle")) + object.paymentCycle = $root.google.cloud.channel.v1.Period.toObject(message.paymentCycle, options); + if (message.trialPeriod != null && message.hasOwnProperty("trialPeriod")) + object.trialPeriod = $root.google.cloud.channel.v1.Period.toObject(message.trialPeriod, options); + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; + return object; + }; + + /** + * Converts this Plan to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Plan + * @instance + * @returns {Object.} JSON object + */ + Plan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Plan + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Plan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Plan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Plan"; + }; + + return Plan; + })(); + + v1.PriceByResource = (function() { + + /** + * Properties of a PriceByResource. + * @memberof google.cloud.channel.v1 + * @interface IPriceByResource + * @property {google.cloud.channel.v1.ResourceType|null} [resourceType] PriceByResource resourceType + * @property {google.cloud.channel.v1.IPrice|null} [price] PriceByResource price + * @property {Array.|null} [pricePhases] PriceByResource pricePhases + */ + + /** + * Constructs a new PriceByResource. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a PriceByResource. + * @implements IPriceByResource + * @constructor + * @param {google.cloud.channel.v1.IPriceByResource=} [properties] Properties to set + */ + function PriceByResource(properties) { + this.pricePhases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceByResource resourceType. + * @member {google.cloud.channel.v1.ResourceType} resourceType + * @memberof google.cloud.channel.v1.PriceByResource + * @instance + */ + PriceByResource.prototype.resourceType = 0; + + /** + * PriceByResource price. + * @member {google.cloud.channel.v1.IPrice|null|undefined} price + * @memberof google.cloud.channel.v1.PriceByResource + * @instance + */ + PriceByResource.prototype.price = null; + + /** + * PriceByResource pricePhases. + * @member {Array.} pricePhases + * @memberof google.cloud.channel.v1.PriceByResource + * @instance + */ + PriceByResource.prototype.pricePhases = $util.emptyArray; + + /** + * Creates a new PriceByResource instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {google.cloud.channel.v1.IPriceByResource=} [properties] Properties to set + * @returns {google.cloud.channel.v1.PriceByResource} PriceByResource instance + */ + PriceByResource.create = function create(properties) { + return new PriceByResource(properties); + }; + + /** + * Encodes the specified PriceByResource message. Does not implicitly {@link google.cloud.channel.v1.PriceByResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {google.cloud.channel.v1.IPriceByResource} message PriceByResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceByResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.resourceType); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.google.cloud.channel.v1.Price.encode(message.price, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pricePhases != null && message.pricePhases.length) + for (var i = 0; i < message.pricePhases.length; ++i) + $root.google.cloud.channel.v1.PricePhase.encode(message.pricePhases[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceByResource message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PriceByResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {google.cloud.channel.v1.IPriceByResource} message PriceByResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceByResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceByResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.PriceByResource} PriceByResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceByResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.PriceByResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.int32(); + break; + } + case 2: { + message.price = $root.google.cloud.channel.v1.Price.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.pricePhases && message.pricePhases.length)) + message.pricePhases = []; + message.pricePhases.push($root.google.cloud.channel.v1.PricePhase.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceByResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.PriceByResource} PriceByResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceByResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceByResource message. + * @function verify + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceByResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.google.cloud.channel.v1.Price.verify(message.price); + if (error) + return "price." + error; + } + if (message.pricePhases != null && message.hasOwnProperty("pricePhases")) { + if (!Array.isArray(message.pricePhases)) + return "pricePhases: array expected"; + for (var i = 0; i < message.pricePhases.length; ++i) { + var error = $root.google.cloud.channel.v1.PricePhase.verify(message.pricePhases[i]); + if (error) + return "pricePhases." + error; + } + } + return null; + }; + + /** + * Creates a PriceByResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.PriceByResource} PriceByResource + */ + PriceByResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.PriceByResource) + return object; + var message = new $root.google.cloud.channel.v1.PriceByResource(); + switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "SEAT": + case 1: + message.resourceType = 1; + break; + case "MAU": + case 2: + message.resourceType = 2; + break; + case "GB": + case 3: + message.resourceType = 3; + break; + case "LICENSED_USER": + case 4: + message.resourceType = 4; + break; + case "MINUTES": + case 5: + message.resourceType = 5; + break; + case "IAAS_USAGE": + case 6: + message.resourceType = 6; + break; + case "SUBSCRIPTION": + case 7: + message.resourceType = 7; + break; + } + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".google.cloud.channel.v1.PriceByResource.price: object expected"); + message.price = $root.google.cloud.channel.v1.Price.fromObject(object.price); + } + if (object.pricePhases) { + if (!Array.isArray(object.pricePhases)) + throw TypeError(".google.cloud.channel.v1.PriceByResource.pricePhases: array expected"); + message.pricePhases = []; + for (var i = 0; i < object.pricePhases.length; ++i) { + if (typeof object.pricePhases[i] !== "object") + throw TypeError(".google.cloud.channel.v1.PriceByResource.pricePhases: object expected"); + message.pricePhases[i] = $root.google.cloud.channel.v1.PricePhase.fromObject(object.pricePhases[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PriceByResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {google.cloud.channel.v1.PriceByResource} message PriceByResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceByResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pricePhases = []; + if (options.defaults) { + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.price = null; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.channel.v1.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.channel.v1.ResourceType[message.resourceType] : message.resourceType; + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.google.cloud.channel.v1.Price.toObject(message.price, options); + if (message.pricePhases && message.pricePhases.length) { + object.pricePhases = []; + for (var j = 0; j < message.pricePhases.length; ++j) + object.pricePhases[j] = $root.google.cloud.channel.v1.PricePhase.toObject(message.pricePhases[j], options); + } + return object; + }; + + /** + * Converts this PriceByResource to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.PriceByResource + * @instance + * @returns {Object.} JSON object + */ + PriceByResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PriceByResource + * @function getTypeUrl + * @memberof google.cloud.channel.v1.PriceByResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PriceByResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.PriceByResource"; + }; + + return PriceByResource; + })(); + + v1.Price = (function() { + + /** + * Properties of a Price. + * @memberof google.cloud.channel.v1 + * @interface IPrice + * @property {google.type.IMoney|null} [basePrice] Price basePrice + * @property {number|null} [discount] Price discount + * @property {google.type.IMoney|null} [effectivePrice] Price effectivePrice + * @property {string|null} [externalPriceUri] Price externalPriceUri + */ + + /** + * Constructs a new Price. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Price. + * @implements IPrice + * @constructor + * @param {google.cloud.channel.v1.IPrice=} [properties] Properties to set + */ + function Price(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Price basePrice. + * @member {google.type.IMoney|null|undefined} basePrice + * @memberof google.cloud.channel.v1.Price + * @instance + */ + Price.prototype.basePrice = null; + + /** + * Price discount. + * @member {number} discount + * @memberof google.cloud.channel.v1.Price + * @instance + */ + Price.prototype.discount = 0; + + /** + * Price effectivePrice. + * @member {google.type.IMoney|null|undefined} effectivePrice + * @memberof google.cloud.channel.v1.Price + * @instance + */ + Price.prototype.effectivePrice = null; + + /** + * Price externalPriceUri. + * @member {string} externalPriceUri + * @memberof google.cloud.channel.v1.Price + * @instance + */ + Price.prototype.externalPriceUri = ""; + + /** + * Creates a new Price instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Price + * @static + * @param {google.cloud.channel.v1.IPrice=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Price} Price instance + */ + Price.create = function create(properties) { + return new Price(properties); + }; + + /** + * Encodes the specified Price message. Does not implicitly {@link google.cloud.channel.v1.Price.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Price + * @static + * @param {google.cloud.channel.v1.IPrice} message Price message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Price.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.basePrice != null && Object.hasOwnProperty.call(message, "basePrice")) + $root.google.type.Money.encode(message.basePrice, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.discount != null && Object.hasOwnProperty.call(message, "discount")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.discount); + if (message.effectivePrice != null && Object.hasOwnProperty.call(message, "effectivePrice")) + $root.google.type.Money.encode(message.effectivePrice, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.externalPriceUri != null && Object.hasOwnProperty.call(message, "externalPriceUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.externalPriceUri); + return writer; + }; + + /** + * Encodes the specified Price message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Price.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Price + * @static + * @param {google.cloud.channel.v1.IPrice} message Price message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Price.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Price message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Price + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Price} Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Price.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Price(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.basePrice = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 2: { + message.discount = reader.double(); + break; + } + case 3: { + message.effectivePrice = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 4: { + message.externalPriceUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Price message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Price + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Price} Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Price.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Price message. + * @function verify + * @memberof google.cloud.channel.v1.Price + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Price.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.basePrice != null && message.hasOwnProperty("basePrice")) { + var error = $root.google.type.Money.verify(message.basePrice); + if (error) + return "basePrice." + error; + } + if (message.discount != null && message.hasOwnProperty("discount")) + if (typeof message.discount !== "number") + return "discount: number expected"; + if (message.effectivePrice != null && message.hasOwnProperty("effectivePrice")) { + var error = $root.google.type.Money.verify(message.effectivePrice); + if (error) + return "effectivePrice." + error; + } + if (message.externalPriceUri != null && message.hasOwnProperty("externalPriceUri")) + if (!$util.isString(message.externalPriceUri)) + return "externalPriceUri: string expected"; + return null; + }; + + /** + * Creates a Price message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Price + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Price} Price + */ + Price.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Price) + return object; + var message = new $root.google.cloud.channel.v1.Price(); + if (object.basePrice != null) { + if (typeof object.basePrice !== "object") + throw TypeError(".google.cloud.channel.v1.Price.basePrice: object expected"); + message.basePrice = $root.google.type.Money.fromObject(object.basePrice); + } + if (object.discount != null) + message.discount = Number(object.discount); + if (object.effectivePrice != null) { + if (typeof object.effectivePrice !== "object") + throw TypeError(".google.cloud.channel.v1.Price.effectivePrice: object expected"); + message.effectivePrice = $root.google.type.Money.fromObject(object.effectivePrice); + } + if (object.externalPriceUri != null) + message.externalPriceUri = String(object.externalPriceUri); + return message; + }; + + /** + * Creates a plain object from a Price message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Price + * @static + * @param {google.cloud.channel.v1.Price} message Price + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Price.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.basePrice = null; + object.discount = 0; + object.effectivePrice = null; + object.externalPriceUri = ""; + } + if (message.basePrice != null && message.hasOwnProperty("basePrice")) + object.basePrice = $root.google.type.Money.toObject(message.basePrice, options); + if (message.discount != null && message.hasOwnProperty("discount")) + object.discount = options.json && !isFinite(message.discount) ? String(message.discount) : message.discount; + if (message.effectivePrice != null && message.hasOwnProperty("effectivePrice")) + object.effectivePrice = $root.google.type.Money.toObject(message.effectivePrice, options); + if (message.externalPriceUri != null && message.hasOwnProperty("externalPriceUri")) + object.externalPriceUri = message.externalPriceUri; + return object; + }; + + /** + * Converts this Price to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Price + * @instance + * @returns {Object.} JSON object + */ + Price.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Price + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Price + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Price.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Price"; + }; + + return Price; + })(); + + v1.PricePhase = (function() { + + /** + * Properties of a PricePhase. + * @memberof google.cloud.channel.v1 + * @interface IPricePhase + * @property {google.cloud.channel.v1.PeriodType|null} [periodType] PricePhase periodType + * @property {number|null} [firstPeriod] PricePhase firstPeriod + * @property {number|null} [lastPeriod] PricePhase lastPeriod + * @property {google.cloud.channel.v1.IPrice|null} [price] PricePhase price + * @property {Array.|null} [priceTiers] PricePhase priceTiers + */ + + /** + * Constructs a new PricePhase. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a PricePhase. + * @implements IPricePhase + * @constructor + * @param {google.cloud.channel.v1.IPricePhase=} [properties] Properties to set + */ + function PricePhase(properties) { + this.priceTiers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PricePhase periodType. + * @member {google.cloud.channel.v1.PeriodType} periodType + * @memberof google.cloud.channel.v1.PricePhase + * @instance + */ + PricePhase.prototype.periodType = 0; + + /** + * PricePhase firstPeriod. + * @member {number} firstPeriod + * @memberof google.cloud.channel.v1.PricePhase + * @instance + */ + PricePhase.prototype.firstPeriod = 0; + + /** + * PricePhase lastPeriod. + * @member {number} lastPeriod + * @memberof google.cloud.channel.v1.PricePhase + * @instance + */ + PricePhase.prototype.lastPeriod = 0; + + /** + * PricePhase price. + * @member {google.cloud.channel.v1.IPrice|null|undefined} price + * @memberof google.cloud.channel.v1.PricePhase + * @instance + */ + PricePhase.prototype.price = null; + + /** + * PricePhase priceTiers. + * @member {Array.} priceTiers + * @memberof google.cloud.channel.v1.PricePhase + * @instance + */ + PricePhase.prototype.priceTiers = $util.emptyArray; + + /** + * Creates a new PricePhase instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {google.cloud.channel.v1.IPricePhase=} [properties] Properties to set + * @returns {google.cloud.channel.v1.PricePhase} PricePhase instance + */ + PricePhase.create = function create(properties) { + return new PricePhase(properties); + }; + + /** + * Encodes the specified PricePhase message. Does not implicitly {@link google.cloud.channel.v1.PricePhase.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {google.cloud.channel.v1.IPricePhase} message PricePhase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricePhase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.periodType != null && Object.hasOwnProperty.call(message, "periodType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.periodType); + if (message.firstPeriod != null && Object.hasOwnProperty.call(message, "firstPeriod")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.firstPeriod); + if (message.lastPeriod != null && Object.hasOwnProperty.call(message, "lastPeriod")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.lastPeriod); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.google.cloud.channel.v1.Price.encode(message.price, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.priceTiers != null && message.priceTiers.length) + for (var i = 0; i < message.priceTiers.length; ++i) + $root.google.cloud.channel.v1.PriceTier.encode(message.priceTiers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PricePhase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PricePhase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {google.cloud.channel.v1.IPricePhase} message PricePhase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PricePhase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PricePhase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.PricePhase} PricePhase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricePhase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.PricePhase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.periodType = reader.int32(); + break; + } + case 2: { + message.firstPeriod = reader.int32(); + break; + } + case 3: { + message.lastPeriod = reader.int32(); + break; + } + case 4: { + message.price = $root.google.cloud.channel.v1.Price.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.priceTiers && message.priceTiers.length)) + message.priceTiers = []; + message.priceTiers.push($root.google.cloud.channel.v1.PriceTier.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PricePhase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.PricePhase} PricePhase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PricePhase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PricePhase message. + * @function verify + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PricePhase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.periodType != null && message.hasOwnProperty("periodType")) + switch (message.periodType) { + default: + return "periodType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.firstPeriod != null && message.hasOwnProperty("firstPeriod")) + if (!$util.isInteger(message.firstPeriod)) + return "firstPeriod: integer expected"; + if (message.lastPeriod != null && message.hasOwnProperty("lastPeriod")) + if (!$util.isInteger(message.lastPeriod)) + return "lastPeriod: integer expected"; + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.google.cloud.channel.v1.Price.verify(message.price); + if (error) + return "price." + error; + } + if (message.priceTiers != null && message.hasOwnProperty("priceTiers")) { + if (!Array.isArray(message.priceTiers)) + return "priceTiers: array expected"; + for (var i = 0; i < message.priceTiers.length; ++i) { + var error = $root.google.cloud.channel.v1.PriceTier.verify(message.priceTiers[i]); + if (error) + return "priceTiers." + error; + } + } + return null; + }; + + /** + * Creates a PricePhase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.PricePhase} PricePhase + */ + PricePhase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.PricePhase) + return object; + var message = new $root.google.cloud.channel.v1.PricePhase(); + switch (object.periodType) { + default: + if (typeof object.periodType === "number") { + message.periodType = object.periodType; + break; + } + break; + case "PERIOD_TYPE_UNSPECIFIED": + case 0: + message.periodType = 0; + break; + case "DAY": + case 1: + message.periodType = 1; + break; + case "MONTH": + case 2: + message.periodType = 2; + break; + case "YEAR": + case 3: + message.periodType = 3; + break; + } + if (object.firstPeriod != null) + message.firstPeriod = object.firstPeriod | 0; + if (object.lastPeriod != null) + message.lastPeriod = object.lastPeriod | 0; + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".google.cloud.channel.v1.PricePhase.price: object expected"); + message.price = $root.google.cloud.channel.v1.Price.fromObject(object.price); + } + if (object.priceTiers) { + if (!Array.isArray(object.priceTiers)) + throw TypeError(".google.cloud.channel.v1.PricePhase.priceTiers: array expected"); + message.priceTiers = []; + for (var i = 0; i < object.priceTiers.length; ++i) { + if (typeof object.priceTiers[i] !== "object") + throw TypeError(".google.cloud.channel.v1.PricePhase.priceTiers: object expected"); + message.priceTiers[i] = $root.google.cloud.channel.v1.PriceTier.fromObject(object.priceTiers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PricePhase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {google.cloud.channel.v1.PricePhase} message PricePhase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PricePhase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.priceTiers = []; + if (options.defaults) { + object.periodType = options.enums === String ? "PERIOD_TYPE_UNSPECIFIED" : 0; + object.firstPeriod = 0; + object.lastPeriod = 0; + object.price = null; + } + if (message.periodType != null && message.hasOwnProperty("periodType")) + object.periodType = options.enums === String ? $root.google.cloud.channel.v1.PeriodType[message.periodType] === undefined ? message.periodType : $root.google.cloud.channel.v1.PeriodType[message.periodType] : message.periodType; + if (message.firstPeriod != null && message.hasOwnProperty("firstPeriod")) + object.firstPeriod = message.firstPeriod; + if (message.lastPeriod != null && message.hasOwnProperty("lastPeriod")) + object.lastPeriod = message.lastPeriod; + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.google.cloud.channel.v1.Price.toObject(message.price, options); + if (message.priceTiers && message.priceTiers.length) { + object.priceTiers = []; + for (var j = 0; j < message.priceTiers.length; ++j) + object.priceTiers[j] = $root.google.cloud.channel.v1.PriceTier.toObject(message.priceTiers[j], options); + } + return object; + }; + + /** + * Converts this PricePhase to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.PricePhase + * @instance + * @returns {Object.} JSON object + */ + PricePhase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PricePhase + * @function getTypeUrl + * @memberof google.cloud.channel.v1.PricePhase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PricePhase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.PricePhase"; + }; + + return PricePhase; + })(); + + v1.PriceTier = (function() { + + /** + * Properties of a PriceTier. + * @memberof google.cloud.channel.v1 + * @interface IPriceTier + * @property {number|null} [firstResource] PriceTier firstResource + * @property {number|null} [lastResource] PriceTier lastResource + * @property {google.cloud.channel.v1.IPrice|null} [price] PriceTier price + */ + + /** + * Constructs a new PriceTier. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a PriceTier. + * @implements IPriceTier + * @constructor + * @param {google.cloud.channel.v1.IPriceTier=} [properties] Properties to set + */ + function PriceTier(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PriceTier firstResource. + * @member {number} firstResource + * @memberof google.cloud.channel.v1.PriceTier + * @instance + */ + PriceTier.prototype.firstResource = 0; + + /** + * PriceTier lastResource. + * @member {number} lastResource + * @memberof google.cloud.channel.v1.PriceTier + * @instance + */ + PriceTier.prototype.lastResource = 0; + + /** + * PriceTier price. + * @member {google.cloud.channel.v1.IPrice|null|undefined} price + * @memberof google.cloud.channel.v1.PriceTier + * @instance + */ + PriceTier.prototype.price = null; + + /** + * Creates a new PriceTier instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {google.cloud.channel.v1.IPriceTier=} [properties] Properties to set + * @returns {google.cloud.channel.v1.PriceTier} PriceTier instance + */ + PriceTier.create = function create(properties) { + return new PriceTier(properties); + }; + + /** + * Encodes the specified PriceTier message. Does not implicitly {@link google.cloud.channel.v1.PriceTier.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {google.cloud.channel.v1.IPriceTier} message PriceTier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceTier.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstResource != null && Object.hasOwnProperty.call(message, "firstResource")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.firstResource); + if (message.lastResource != null && Object.hasOwnProperty.call(message, "lastResource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lastResource); + if (message.price != null && Object.hasOwnProperty.call(message, "price")) + $root.google.cloud.channel.v1.Price.encode(message.price, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceTier message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PriceTier.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {google.cloud.channel.v1.IPriceTier} message PriceTier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceTier.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceTier message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.PriceTier} PriceTier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceTier.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.PriceTier(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.firstResource = reader.int32(); + break; + } + case 2: { + message.lastResource = reader.int32(); + break; + } + case 3: { + message.price = $root.google.cloud.channel.v1.Price.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceTier message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.PriceTier} PriceTier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceTier.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceTier message. + * @function verify + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceTier.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstResource != null && message.hasOwnProperty("firstResource")) + if (!$util.isInteger(message.firstResource)) + return "firstResource: integer expected"; + if (message.lastResource != null && message.hasOwnProperty("lastResource")) + if (!$util.isInteger(message.lastResource)) + return "lastResource: integer expected"; + if (message.price != null && message.hasOwnProperty("price")) { + var error = $root.google.cloud.channel.v1.Price.verify(message.price); + if (error) + return "price." + error; + } + return null; + }; + + /** + * Creates a PriceTier message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.PriceTier} PriceTier + */ + PriceTier.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.PriceTier) + return object; + var message = new $root.google.cloud.channel.v1.PriceTier(); + if (object.firstResource != null) + message.firstResource = object.firstResource | 0; + if (object.lastResource != null) + message.lastResource = object.lastResource | 0; + if (object.price != null) { + if (typeof object.price !== "object") + throw TypeError(".google.cloud.channel.v1.PriceTier.price: object expected"); + message.price = $root.google.cloud.channel.v1.Price.fromObject(object.price); + } + return message; + }; + + /** + * Creates a plain object from a PriceTier message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {google.cloud.channel.v1.PriceTier} message PriceTier + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceTier.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstResource = 0; + object.lastResource = 0; + object.price = null; + } + if (message.firstResource != null && message.hasOwnProperty("firstResource")) + object.firstResource = message.firstResource; + if (message.lastResource != null && message.hasOwnProperty("lastResource")) + object.lastResource = message.lastResource; + if (message.price != null && message.hasOwnProperty("price")) + object.price = $root.google.cloud.channel.v1.Price.toObject(message.price, options); + return object; + }; + + /** + * Converts this PriceTier to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.PriceTier + * @instance + * @returns {Object.} JSON object + */ + PriceTier.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PriceTier + * @function getTypeUrl + * @memberof google.cloud.channel.v1.PriceTier + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PriceTier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.PriceTier"; + }; + + return PriceTier; + })(); + + v1.Period = (function() { + + /** + * Properties of a Period. + * @memberof google.cloud.channel.v1 + * @interface IPeriod + * @property {number|null} [duration] Period duration + * @property {google.cloud.channel.v1.PeriodType|null} [periodType] Period periodType + */ + + /** + * Constructs a new Period. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Period. + * @implements IPeriod + * @constructor + * @param {google.cloud.channel.v1.IPeriod=} [properties] Properties to set + */ + function Period(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Period duration. + * @member {number} duration + * @memberof google.cloud.channel.v1.Period + * @instance + */ + Period.prototype.duration = 0; + + /** + * Period periodType. + * @member {google.cloud.channel.v1.PeriodType} periodType + * @memberof google.cloud.channel.v1.Period + * @instance + */ + Period.prototype.periodType = 0; + + /** + * Creates a new Period instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Period + * @static + * @param {google.cloud.channel.v1.IPeriod=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Period} Period instance + */ + Period.create = function create(properties) { + return new Period(properties); + }; + + /** + * Encodes the specified Period message. Does not implicitly {@link google.cloud.channel.v1.Period.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Period + * @static + * @param {google.cloud.channel.v1.IPeriod} message Period message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Period.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.duration); + if (message.periodType != null && Object.hasOwnProperty.call(message, "periodType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.periodType); + return writer; + }; + + /** + * Encodes the specified Period message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Period.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Period + * @static + * @param {google.cloud.channel.v1.IPeriod} message Period message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Period.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Period message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Period + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Period} Period + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Period.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Period(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.duration = reader.int32(); + break; + } + case 2: { + message.periodType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Period message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Period + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Period} Period + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Period.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Period message. + * @function verify + * @memberof google.cloud.channel.v1.Period + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Period.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.duration != null && message.hasOwnProperty("duration")) + if (!$util.isInteger(message.duration)) + return "duration: integer expected"; + if (message.periodType != null && message.hasOwnProperty("periodType")) + switch (message.periodType) { + default: + return "periodType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Period message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Period + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Period} Period + */ + Period.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Period) + return object; + var message = new $root.google.cloud.channel.v1.Period(); + if (object.duration != null) + message.duration = object.duration | 0; + switch (object.periodType) { + default: + if (typeof object.periodType === "number") { + message.periodType = object.periodType; + break; + } + break; + case "PERIOD_TYPE_UNSPECIFIED": + case 0: + message.periodType = 0; + break; + case "DAY": + case 1: + message.periodType = 1; + break; + case "MONTH": + case 2: + message.periodType = 2; + break; + case "YEAR": + case 3: + message.periodType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Period message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Period + * @static + * @param {google.cloud.channel.v1.Period} message Period + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Period.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.duration = 0; + object.periodType = options.enums === String ? "PERIOD_TYPE_UNSPECIFIED" : 0; + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = message.duration; + if (message.periodType != null && message.hasOwnProperty("periodType")) + object.periodType = options.enums === String ? $root.google.cloud.channel.v1.PeriodType[message.periodType] === undefined ? message.periodType : $root.google.cloud.channel.v1.PeriodType[message.periodType] : message.periodType; + return object; + }; + + /** + * Converts this Period to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Period + * @instance + * @returns {Object.} JSON object + */ + Period.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Period + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Period + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Period.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Period"; + }; + + return Period; + })(); + + /** + * MediaType enum. + * @name google.cloud.channel.v1.MediaType + * @enum {number} + * @property {number} MEDIA_TYPE_UNSPECIFIED=0 MEDIA_TYPE_UNSPECIFIED value + * @property {number} MEDIA_TYPE_IMAGE=1 MEDIA_TYPE_IMAGE value + */ + v1.MediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEDIA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEDIA_TYPE_IMAGE"] = 1; + return values; + })(); + + v1.Product = (function() { + + /** + * Properties of a Product. + * @memberof google.cloud.channel.v1 + * @interface IProduct + * @property {string|null} [name] Product name + * @property {google.cloud.channel.v1.IMarketingInfo|null} [marketingInfo] Product marketingInfo + */ + + /** + * Constructs a new Product. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {google.cloud.channel.v1.IProduct=} [properties] Properties to set + */ + function Product(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Product name. + * @member {string} name + * @memberof google.cloud.channel.v1.Product + * @instance + */ + Product.prototype.name = ""; + + /** + * Product marketingInfo. + * @member {google.cloud.channel.v1.IMarketingInfo|null|undefined} marketingInfo + * @memberof google.cloud.channel.v1.Product + * @instance + */ + Product.prototype.marketingInfo = null; + + /** + * Creates a new Product instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Product + * @static + * @param {google.cloud.channel.v1.IProduct=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Product} Product instance + */ + Product.create = function create(properties) { + return new Product(properties); + }; + + /** + * Encodes the specified Product message. Does not implicitly {@link google.cloud.channel.v1.Product.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Product + * @static + * @param {google.cloud.channel.v1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.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.marketingInfo != null && Object.hasOwnProperty.call(message, "marketingInfo")) + $root.google.cloud.channel.v1.MarketingInfo.encode(message.marketingInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Product message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Product.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Product + * @static + * @param {google.cloud.channel.v1.IProduct} message Product message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Product.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Product message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Product(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Product message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Product + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Product} Product + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Product.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Product message. + * @function verify + * @memberof google.cloud.channel.v1.Product + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Product.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.marketingInfo != null && message.hasOwnProperty("marketingInfo")) { + var error = $root.google.cloud.channel.v1.MarketingInfo.verify(message.marketingInfo); + if (error) + return "marketingInfo." + error; + } + return null; + }; + + /** + * Creates a Product message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Product + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Product} Product + */ + Product.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Product) + return object; + var message = new $root.google.cloud.channel.v1.Product(); + if (object.name != null) + message.name = String(object.name); + if (object.marketingInfo != null) { + if (typeof object.marketingInfo !== "object") + throw TypeError(".google.cloud.channel.v1.Product.marketingInfo: object expected"); + message.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.fromObject(object.marketingInfo); + } + return message; + }; + + /** + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Product + * @static + * @param {google.cloud.channel.v1.Product} message Product + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Product.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.marketingInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.marketingInfo != null && message.hasOwnProperty("marketingInfo")) + object.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.toObject(message.marketingInfo, options); + return object; + }; + + /** + * Converts this Product to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Product + * @instance + * @returns {Object.} JSON object + */ + Product.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Product + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Product + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Product.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Product"; + }; + + return Product; + })(); + + v1.Sku = (function() { + + /** + * Properties of a Sku. + * @memberof google.cloud.channel.v1 + * @interface ISku + * @property {string|null} [name] Sku name + * @property {google.cloud.channel.v1.IMarketingInfo|null} [marketingInfo] Sku marketingInfo + * @property {google.cloud.channel.v1.IProduct|null} [product] Sku product + */ + + /** + * Constructs a new Sku. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Sku. + * @implements ISku + * @constructor + * @param {google.cloud.channel.v1.ISku=} [properties] Properties to set + */ + function Sku(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Sku name. + * @member {string} name + * @memberof google.cloud.channel.v1.Sku + * @instance + */ + Sku.prototype.name = ""; + + /** + * Sku marketingInfo. + * @member {google.cloud.channel.v1.IMarketingInfo|null|undefined} marketingInfo + * @memberof google.cloud.channel.v1.Sku + * @instance + */ + Sku.prototype.marketingInfo = null; + + /** + * Sku product. + * @member {google.cloud.channel.v1.IProduct|null|undefined} product + * @memberof google.cloud.channel.v1.Sku + * @instance + */ + Sku.prototype.product = null; + + /** + * Creates a new Sku instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {google.cloud.channel.v1.ISku=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Sku} Sku instance + */ + Sku.create = function create(properties) { + return new Sku(properties); + }; + + /** + * Encodes the specified Sku message. Does not implicitly {@link google.cloud.channel.v1.Sku.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {google.cloud.channel.v1.ISku} message Sku message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sku.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.marketingInfo != null && Object.hasOwnProperty.call(message, "marketingInfo")) + $root.google.cloud.channel.v1.MarketingInfo.encode(message.marketingInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.google.cloud.channel.v1.Product.encode(message.product, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Sku message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Sku.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {google.cloud.channel.v1.ISku} message Sku message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sku.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sku message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Sku} Sku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sku.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Sku(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.product = $root.google.cloud.channel.v1.Product.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sku message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Sku} Sku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sku.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sku message. + * @function verify + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sku.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.marketingInfo != null && message.hasOwnProperty("marketingInfo")) { + var error = $root.google.cloud.channel.v1.MarketingInfo.verify(message.marketingInfo); + if (error) + return "marketingInfo." + error; + } + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.google.cloud.channel.v1.Product.verify(message.product); + if (error) + return "product." + error; + } + return null; + }; + + /** + * Creates a Sku message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Sku} Sku + */ + Sku.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Sku) + return object; + var message = new $root.google.cloud.channel.v1.Sku(); + if (object.name != null) + message.name = String(object.name); + if (object.marketingInfo != null) { + if (typeof object.marketingInfo !== "object") + throw TypeError(".google.cloud.channel.v1.Sku.marketingInfo: object expected"); + message.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.fromObject(object.marketingInfo); + } + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".google.cloud.channel.v1.Sku.product: object expected"); + message.product = $root.google.cloud.channel.v1.Product.fromObject(object.product); + } + return message; + }; + + /** + * Creates a plain object from a Sku message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {google.cloud.channel.v1.Sku} message Sku + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sku.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.marketingInfo = null; + object.product = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.marketingInfo != null && message.hasOwnProperty("marketingInfo")) + object.marketingInfo = $root.google.cloud.channel.v1.MarketingInfo.toObject(message.marketingInfo, options); + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.google.cloud.channel.v1.Product.toObject(message.product, options); + return object; + }; + + /** + * Converts this Sku to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Sku + * @instance + * @returns {Object.} JSON object + */ + Sku.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Sku + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Sku + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sku.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Sku"; + }; + + return Sku; + })(); + + v1.MarketingInfo = (function() { + + /** + * Properties of a MarketingInfo. + * @memberof google.cloud.channel.v1 + * @interface IMarketingInfo + * @property {string|null} [displayName] MarketingInfo displayName + * @property {string|null} [description] MarketingInfo description + * @property {google.cloud.channel.v1.IMedia|null} [defaultLogo] MarketingInfo defaultLogo + */ + + /** + * Constructs a new MarketingInfo. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a MarketingInfo. + * @implements IMarketingInfo + * @constructor + * @param {google.cloud.channel.v1.IMarketingInfo=} [properties] Properties to set + */ + function MarketingInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MarketingInfo displayName. + * @member {string} displayName + * @memberof google.cloud.channel.v1.MarketingInfo + * @instance + */ + MarketingInfo.prototype.displayName = ""; + + /** + * MarketingInfo description. + * @member {string} description + * @memberof google.cloud.channel.v1.MarketingInfo + * @instance + */ + MarketingInfo.prototype.description = ""; + + /** + * MarketingInfo defaultLogo. + * @member {google.cloud.channel.v1.IMedia|null|undefined} defaultLogo + * @memberof google.cloud.channel.v1.MarketingInfo + * @instance + */ + MarketingInfo.prototype.defaultLogo = null; + + /** + * Creates a new MarketingInfo instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {google.cloud.channel.v1.IMarketingInfo=} [properties] Properties to set + * @returns {google.cloud.channel.v1.MarketingInfo} MarketingInfo instance + */ + MarketingInfo.create = function create(properties) { + return new MarketingInfo(properties); + }; + + /** + * Encodes the specified MarketingInfo message. Does not implicitly {@link google.cloud.channel.v1.MarketingInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {google.cloud.channel.v1.IMarketingInfo} message MarketingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarketingInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.defaultLogo != null && Object.hasOwnProperty.call(message, "defaultLogo")) + $root.google.cloud.channel.v1.Media.encode(message.defaultLogo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MarketingInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.MarketingInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {google.cloud.channel.v1.IMarketingInfo} message MarketingInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MarketingInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MarketingInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.MarketingInfo} MarketingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarketingInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.MarketingInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.defaultLogo = $root.google.cloud.channel.v1.Media.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MarketingInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.MarketingInfo} MarketingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MarketingInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MarketingInfo message. + * @function verify + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MarketingInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.defaultLogo != null && message.hasOwnProperty("defaultLogo")) { + var error = $root.google.cloud.channel.v1.Media.verify(message.defaultLogo); + if (error) + return "defaultLogo." + error; + } + return null; + }; + + /** + * Creates a MarketingInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.MarketingInfo} MarketingInfo + */ + MarketingInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.MarketingInfo) + return object; + var message = new $root.google.cloud.channel.v1.MarketingInfo(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.defaultLogo != null) { + if (typeof object.defaultLogo !== "object") + throw TypeError(".google.cloud.channel.v1.MarketingInfo.defaultLogo: object expected"); + message.defaultLogo = $root.google.cloud.channel.v1.Media.fromObject(object.defaultLogo); + } + return message; + }; + + /** + * Creates a plain object from a MarketingInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {google.cloud.channel.v1.MarketingInfo} message MarketingInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MarketingInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.description = ""; + object.defaultLogo = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.defaultLogo != null && message.hasOwnProperty("defaultLogo")) + object.defaultLogo = $root.google.cloud.channel.v1.Media.toObject(message.defaultLogo, options); + return object; + }; + + /** + * Converts this MarketingInfo to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.MarketingInfo + * @instance + * @returns {Object.} JSON object + */ + MarketingInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MarketingInfo + * @function getTypeUrl + * @memberof google.cloud.channel.v1.MarketingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MarketingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.MarketingInfo"; + }; + + return MarketingInfo; + })(); + + v1.Media = (function() { + + /** + * Properties of a Media. + * @memberof google.cloud.channel.v1 + * @interface IMedia + * @property {string|null} [title] Media title + * @property {string|null} [content] Media content + * @property {google.cloud.channel.v1.MediaType|null} [type] Media type + */ + + /** + * Constructs a new Media. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Media. + * @implements IMedia + * @constructor + * @param {google.cloud.channel.v1.IMedia=} [properties] Properties to set + */ + function Media(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Media title. + * @member {string} title + * @memberof google.cloud.channel.v1.Media + * @instance + */ + Media.prototype.title = ""; + + /** + * Media content. + * @member {string} content + * @memberof google.cloud.channel.v1.Media + * @instance + */ + Media.prototype.content = ""; + + /** + * Media type. + * @member {google.cloud.channel.v1.MediaType} type + * @memberof google.cloud.channel.v1.Media + * @instance + */ + Media.prototype.type = 0; + + /** + * Creates a new Media instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Media + * @static + * @param {google.cloud.channel.v1.IMedia=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Media} Media instance + */ + Media.create = function create(properties) { + return new Media(properties); + }; + + /** + * Encodes the specified Media message. Does not implicitly {@link google.cloud.channel.v1.Media.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Media + * @static + * @param {google.cloud.channel.v1.IMedia} message Media message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Media.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + return writer; + }; + + /** + * Encodes the specified Media message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Media.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Media + * @static + * @param {google.cloud.channel.v1.IMedia} message Media message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Media.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Media message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Media + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Media} Media + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Media.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Media(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Media message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Media + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Media} Media + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Media.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Media message. + * @function verify + * @memberof google.cloud.channel.v1.Media + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Media.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Media message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Media + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Media} Media + */ + Media.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Media) + return object; + var message = new $root.google.cloud.channel.v1.Media(); + if (object.title != null) + message.title = String(object.title); + if (object.content != null) + message.content = String(object.content); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "MEDIA_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "MEDIA_TYPE_IMAGE": + case 1: + message.type = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Media message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Media + * @static + * @param {google.cloud.channel.v1.Media} message Media + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Media.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.content = ""; + object.type = options.enums === String ? "MEDIA_TYPE_UNSPECIFIED" : 0; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.channel.v1.MediaType[message.type] === undefined ? message.type : $root.google.cloud.channel.v1.MediaType[message.type] : message.type; + return object; + }; + + /** + * Converts this Media to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Media + * @instance + * @returns {Object.} JSON object + */ + Media.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Media + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Media + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Media.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Media"; + }; + + return Media; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.channel.v1 + * @interface IOperationMetadata + * @property {google.cloud.channel.v1.OperationMetadata.OperationType|null} [operationType] OperationMetadata operationType + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.channel.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (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 operationType. + * @member {google.cloud.channel.v1.OperationMetadata.OperationType} operationType + * @memberof google.cloud.channel.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.operationType = 0; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.OperationMetadata + * @static + * @param {google.cloud.channel.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.channel.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.channel.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.OperationMetadata + * @static + * @param {google.cloud.channel.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.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operationType); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.channel.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.OperationMetadata + * @static + * @param {google.cloud.channel.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.channel.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.channel.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.channel.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.operationType = reader.int32(); + 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.channel.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.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.channel.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.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 3: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + case 14: + case 15: + case 16: + break; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.channel.v1.OperationMetadata(); + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "CREATE_ENTITLEMENT": + case 1: + message.operationType = 1; + break; + case "CHANGE_RENEWAL_SETTINGS": + case 3: + message.operationType = 3; + break; + case "START_PAID_SERVICE": + case 5: + message.operationType = 5; + break; + case "ACTIVATE_ENTITLEMENT": + case 7: + message.operationType = 7; + break; + case "SUSPEND_ENTITLEMENT": + case 8: + message.operationType = 8; + break; + case "CANCEL_ENTITLEMENT": + case 9: + message.operationType = 9; + break; + case "TRANSFER_ENTITLEMENTS": + case 10: + message.operationType = 10; + break; + case "TRANSFER_ENTITLEMENTS_TO_GOOGLE": + case 11: + message.operationType = 11; + break; + case "CHANGE_OFFER": + case 14: + message.operationType = 14; + break; + case "CHANGE_PARAMETERS": + case 15: + message.operationType = 15; + break; + case "PROVISION_CLOUD_IDENTITY": + case 16: + message.operationType = 16; + break; + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.OperationMetadata + * @static + * @param {google.cloud.channel.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.defaults) + object.operationType = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.channel.v1.OperationMetadata.OperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.channel.v1.OperationMetadata.OperationType[message.operationType] : message.operationType; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.channel.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.channel.v1.OperationMetadata"; + }; + + /** + * OperationType enum. + * @name google.cloud.channel.v1.OperationMetadata.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} CREATE_ENTITLEMENT=1 CREATE_ENTITLEMENT value + * @property {number} CHANGE_RENEWAL_SETTINGS=3 CHANGE_RENEWAL_SETTINGS value + * @property {number} START_PAID_SERVICE=5 START_PAID_SERVICE value + * @property {number} ACTIVATE_ENTITLEMENT=7 ACTIVATE_ENTITLEMENT value + * @property {number} SUSPEND_ENTITLEMENT=8 SUSPEND_ENTITLEMENT value + * @property {number} CANCEL_ENTITLEMENT=9 CANCEL_ENTITLEMENT value + * @property {number} TRANSFER_ENTITLEMENTS=10 TRANSFER_ENTITLEMENTS value + * @property {number} TRANSFER_ENTITLEMENTS_TO_GOOGLE=11 TRANSFER_ENTITLEMENTS_TO_GOOGLE value + * @property {number} CHANGE_OFFER=14 CHANGE_OFFER value + * @property {number} CHANGE_PARAMETERS=15 CHANGE_PARAMETERS value + * @property {number} PROVISION_CLOUD_IDENTITY=16 PROVISION_CLOUD_IDENTITY value + */ + OperationMetadata.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE_ENTITLEMENT"] = 1; + values[valuesById[3] = "CHANGE_RENEWAL_SETTINGS"] = 3; + values[valuesById[5] = "START_PAID_SERVICE"] = 5; + values[valuesById[7] = "ACTIVATE_ENTITLEMENT"] = 7; + values[valuesById[8] = "SUSPEND_ENTITLEMENT"] = 8; + values[valuesById[9] = "CANCEL_ENTITLEMENT"] = 9; + values[valuesById[10] = "TRANSFER_ENTITLEMENTS"] = 10; + values[valuesById[11] = "TRANSFER_ENTITLEMENTS_TO_GOOGLE"] = 11; + values[valuesById[14] = "CHANGE_OFFER"] = 14; + values[valuesById[15] = "CHANGE_PARAMETERS"] = 15; + values[valuesById[16] = "PROVISION_CLOUD_IDENTITY"] = 16; + return values; + })(); + + return OperationMetadata; + })(); + + v1.CloudChannelReportsService = (function() { + + /** + * Constructs a new CloudChannelReportsService service. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CloudChannelReportsService + * @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 CloudChannelReportsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudChannelReportsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudChannelReportsService; + + /** + * Creates new CloudChannelReportsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @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 {CloudChannelReportsService} RPC service. Useful where requests and/or responses are streamed. + */ + CloudChannelReportsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelReportsService|runReportJob}. + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @typedef RunReportJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunReportJob. + * @function runReportJob + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @instance + * @param {google.cloud.channel.v1.IRunReportJobRequest} request RunReportJobRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelReportsService.RunReportJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelReportsService.prototype.runReportJob = function runReportJob(request, callback) { + return this.rpcCall(runReportJob, $root.google.cloud.channel.v1.RunReportJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunReportJob" }); + + /** + * Calls RunReportJob. + * @function runReportJob + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @instance + * @param {google.cloud.channel.v1.IRunReportJobRequest} request RunReportJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelReportsService|fetchReportResults}. + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @typedef FetchReportResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.FetchReportResultsResponse} [response] FetchReportResultsResponse + */ + + /** + * Calls FetchReportResults. + * @function fetchReportResults + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @instance + * @param {google.cloud.channel.v1.IFetchReportResultsRequest} request FetchReportResultsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelReportsService.FetchReportResultsCallback} callback Node-style callback called with the error, if any, and FetchReportResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelReportsService.prototype.fetchReportResults = function fetchReportResults(request, callback) { + return this.rpcCall(fetchReportResults, $root.google.cloud.channel.v1.FetchReportResultsRequest, $root.google.cloud.channel.v1.FetchReportResultsResponse, request, callback); + }, "name", { value: "FetchReportResults" }); + + /** + * Calls FetchReportResults. + * @function fetchReportResults + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @instance + * @param {google.cloud.channel.v1.IFetchReportResultsRequest} request FetchReportResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelReportsService|listReports}. + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @typedef ListReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListReportsResponse} [response] ListReportsResponse + */ + + /** + * Calls ListReports. + * @function listReports + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @instance + * @param {google.cloud.channel.v1.IListReportsRequest} request ListReportsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelReportsService.ListReportsCallback} callback Node-style callback called with the error, if any, and ListReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelReportsService.prototype.listReports = function listReports(request, callback) { + return this.rpcCall(listReports, $root.google.cloud.channel.v1.ListReportsRequest, $root.google.cloud.channel.v1.ListReportsResponse, request, callback); + }, "name", { value: "ListReports" }); + + /** + * Calls ListReports. + * @function listReports + * @memberof google.cloud.channel.v1.CloudChannelReportsService + * @instance + * @param {google.cloud.channel.v1.IListReportsRequest} request ListReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudChannelReportsService; + })(); + + v1.RunReportJobRequest = (function() { + + /** + * Properties of a RunReportJobRequest. + * @memberof google.cloud.channel.v1 + * @interface IRunReportJobRequest + * @property {string|null} [name] RunReportJobRequest name + * @property {google.cloud.channel.v1.IDateRange|null} [dateRange] RunReportJobRequest dateRange + * @property {string|null} [filter] RunReportJobRequest filter + * @property {string|null} [languageCode] RunReportJobRequest languageCode + */ + + /** + * Constructs a new RunReportJobRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RunReportJobRequest. + * @implements IRunReportJobRequest + * @constructor + * @param {google.cloud.channel.v1.IRunReportJobRequest=} [properties] Properties to set + */ + function RunReportJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunReportJobRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @instance + */ + RunReportJobRequest.prototype.name = ""; + + /** + * RunReportJobRequest dateRange. + * @member {google.cloud.channel.v1.IDateRange|null|undefined} dateRange + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @instance + */ + RunReportJobRequest.prototype.dateRange = null; + + /** + * RunReportJobRequest filter. + * @member {string} filter + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @instance + */ + RunReportJobRequest.prototype.filter = ""; + + /** + * RunReportJobRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @instance + */ + RunReportJobRequest.prototype.languageCode = ""; + + /** + * Creates a new RunReportJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {google.cloud.channel.v1.IRunReportJobRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RunReportJobRequest} RunReportJobRequest instance + */ + RunReportJobRequest.create = function create(properties) { + return new RunReportJobRequest(properties); + }; + + /** + * Encodes the specified RunReportJobRequest message. Does not implicitly {@link google.cloud.channel.v1.RunReportJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {google.cloud.channel.v1.IRunReportJobRequest} message RunReportJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportJobRequest.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.dateRange != null && Object.hasOwnProperty.call(message, "dateRange")) + $root.google.cloud.channel.v1.DateRange.encode(message.dateRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified RunReportJobRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RunReportJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {google.cloud.channel.v1.IRunReportJobRequest} message RunReportJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunReportJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RunReportJobRequest} RunReportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RunReportJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dateRange = $root.google.cloud.channel.v1.DateRange.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunReportJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RunReportJobRequest} RunReportJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunReportJobRequest message. + * @function verify + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunReportJobRequest.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.dateRange != null && message.hasOwnProperty("dateRange")) { + var error = $root.google.cloud.channel.v1.DateRange.verify(message.dateRange); + if (error) + return "dateRange." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a RunReportJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RunReportJobRequest} RunReportJobRequest + */ + RunReportJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RunReportJobRequest) + return object; + var message = new $root.google.cloud.channel.v1.RunReportJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.dateRange != null) { + if (typeof object.dateRange !== "object") + throw TypeError(".google.cloud.channel.v1.RunReportJobRequest.dateRange: object expected"); + message.dateRange = $root.google.cloud.channel.v1.DateRange.fromObject(object.dateRange); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a RunReportJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {google.cloud.channel.v1.RunReportJobRequest} message RunReportJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunReportJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dateRange = null; + object.filter = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dateRange != null && message.hasOwnProperty("dateRange")) + object.dateRange = $root.google.cloud.channel.v1.DateRange.toObject(message.dateRange, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this RunReportJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @instance + * @returns {Object.} JSON object + */ + RunReportJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunReportJobRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RunReportJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunReportJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RunReportJobRequest"; + }; + + return RunReportJobRequest; + })(); + + v1.RunReportJobResponse = (function() { + + /** + * Properties of a RunReportJobResponse. + * @memberof google.cloud.channel.v1 + * @interface IRunReportJobResponse + * @property {google.cloud.channel.v1.IReportJob|null} [reportJob] RunReportJobResponse reportJob + * @property {google.cloud.channel.v1.IReportResultsMetadata|null} [reportMetadata] RunReportJobResponse reportMetadata + */ + + /** + * Constructs a new RunReportJobResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RunReportJobResponse. + * @implements IRunReportJobResponse + * @constructor + * @param {google.cloud.channel.v1.IRunReportJobResponse=} [properties] Properties to set + */ + function RunReportJobResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunReportJobResponse reportJob. + * @member {google.cloud.channel.v1.IReportJob|null|undefined} reportJob + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @instance + */ + RunReportJobResponse.prototype.reportJob = null; + + /** + * RunReportJobResponse reportMetadata. + * @member {google.cloud.channel.v1.IReportResultsMetadata|null|undefined} reportMetadata + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @instance + */ + RunReportJobResponse.prototype.reportMetadata = null; + + /** + * Creates a new RunReportJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {google.cloud.channel.v1.IRunReportJobResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RunReportJobResponse} RunReportJobResponse instance + */ + RunReportJobResponse.create = function create(properties) { + return new RunReportJobResponse(properties); + }; + + /** + * Encodes the specified RunReportJobResponse message. Does not implicitly {@link google.cloud.channel.v1.RunReportJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {google.cloud.channel.v1.IRunReportJobResponse} message RunReportJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reportJob != null && Object.hasOwnProperty.call(message, "reportJob")) + $root.google.cloud.channel.v1.ReportJob.encode(message.reportJob, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reportMetadata != null && Object.hasOwnProperty.call(message, "reportMetadata")) + $root.google.cloud.channel.v1.ReportResultsMetadata.encode(message.reportMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunReportJobResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RunReportJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {google.cloud.channel.v1.IRunReportJobResponse} message RunReportJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunReportJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunReportJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RunReportJobResponse} RunReportJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportJobResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RunReportJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reportJob = $root.google.cloud.channel.v1.ReportJob.decode(reader, reader.uint32()); + break; + } + case 2: { + message.reportMetadata = $root.google.cloud.channel.v1.ReportResultsMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunReportJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RunReportJobResponse} RunReportJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunReportJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunReportJobResponse message. + * @function verify + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunReportJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reportJob != null && message.hasOwnProperty("reportJob")) { + var error = $root.google.cloud.channel.v1.ReportJob.verify(message.reportJob); + if (error) + return "reportJob." + error; + } + if (message.reportMetadata != null && message.hasOwnProperty("reportMetadata")) { + var error = $root.google.cloud.channel.v1.ReportResultsMetadata.verify(message.reportMetadata); + if (error) + return "reportMetadata." + error; + } + return null; + }; + + /** + * Creates a RunReportJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RunReportJobResponse} RunReportJobResponse + */ + RunReportJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RunReportJobResponse) + return object; + var message = new $root.google.cloud.channel.v1.RunReportJobResponse(); + if (object.reportJob != null) { + if (typeof object.reportJob !== "object") + throw TypeError(".google.cloud.channel.v1.RunReportJobResponse.reportJob: object expected"); + message.reportJob = $root.google.cloud.channel.v1.ReportJob.fromObject(object.reportJob); + } + if (object.reportMetadata != null) { + if (typeof object.reportMetadata !== "object") + throw TypeError(".google.cloud.channel.v1.RunReportJobResponse.reportMetadata: object expected"); + message.reportMetadata = $root.google.cloud.channel.v1.ReportResultsMetadata.fromObject(object.reportMetadata); + } + return message; + }; + + /** + * Creates a plain object from a RunReportJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {google.cloud.channel.v1.RunReportJobResponse} message RunReportJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunReportJobResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reportJob = null; + object.reportMetadata = null; + } + if (message.reportJob != null && message.hasOwnProperty("reportJob")) + object.reportJob = $root.google.cloud.channel.v1.ReportJob.toObject(message.reportJob, options); + if (message.reportMetadata != null && message.hasOwnProperty("reportMetadata")) + object.reportMetadata = $root.google.cloud.channel.v1.ReportResultsMetadata.toObject(message.reportMetadata, options); + return object; + }; + + /** + * Converts this RunReportJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @instance + * @returns {Object.} JSON object + */ + RunReportJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunReportJobResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RunReportJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunReportJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RunReportJobResponse"; + }; + + return RunReportJobResponse; + })(); + + v1.FetchReportResultsRequest = (function() { + + /** + * Properties of a FetchReportResultsRequest. + * @memberof google.cloud.channel.v1 + * @interface IFetchReportResultsRequest + * @property {string|null} [reportJob] FetchReportResultsRequest reportJob + * @property {number|null} [pageSize] FetchReportResultsRequest pageSize + * @property {string|null} [pageToken] FetchReportResultsRequest pageToken + */ + + /** + * Constructs a new FetchReportResultsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a FetchReportResultsRequest. + * @implements IFetchReportResultsRequest + * @constructor + * @param {google.cloud.channel.v1.IFetchReportResultsRequest=} [properties] Properties to set + */ + function FetchReportResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchReportResultsRequest reportJob. + * @member {string} reportJob + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @instance + */ + FetchReportResultsRequest.prototype.reportJob = ""; + + /** + * FetchReportResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @instance + */ + FetchReportResultsRequest.prototype.pageSize = 0; + + /** + * FetchReportResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @instance + */ + FetchReportResultsRequest.prototype.pageToken = ""; + + /** + * Creates a new FetchReportResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {google.cloud.channel.v1.IFetchReportResultsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.FetchReportResultsRequest} FetchReportResultsRequest instance + */ + FetchReportResultsRequest.create = function create(properties) { + return new FetchReportResultsRequest(properties); + }; + + /** + * Encodes the specified FetchReportResultsRequest message. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {google.cloud.channel.v1.IFetchReportResultsRequest} message FetchReportResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchReportResultsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reportJob != null && Object.hasOwnProperty.call(message, "reportJob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.reportJob); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified FetchReportResultsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {google.cloud.channel.v1.IFetchReportResultsRequest} message FetchReportResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchReportResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchReportResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.FetchReportResultsRequest} FetchReportResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchReportResultsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.FetchReportResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reportJob = 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 FetchReportResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.FetchReportResultsRequest} FetchReportResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchReportResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchReportResultsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchReportResultsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reportJob != null && message.hasOwnProperty("reportJob")) + if (!$util.isString(message.reportJob)) + return "reportJob: 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 FetchReportResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.FetchReportResultsRequest} FetchReportResultsRequest + */ + FetchReportResultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.FetchReportResultsRequest) + return object; + var message = new $root.google.cloud.channel.v1.FetchReportResultsRequest(); + if (object.reportJob != null) + message.reportJob = String(object.reportJob); + 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 FetchReportResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {google.cloud.channel.v1.FetchReportResultsRequest} message FetchReportResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchReportResultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reportJob = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.reportJob != null && message.hasOwnProperty("reportJob")) + object.reportJob = message.reportJob; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this FetchReportResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchReportResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchReportResultsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.FetchReportResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchReportResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.FetchReportResultsRequest"; + }; + + return FetchReportResultsRequest; + })(); + + v1.FetchReportResultsResponse = (function() { + + /** + * Properties of a FetchReportResultsResponse. + * @memberof google.cloud.channel.v1 + * @interface IFetchReportResultsResponse + * @property {google.cloud.channel.v1.IReportResultsMetadata|null} [reportMetadata] FetchReportResultsResponse reportMetadata + * @property {Array.|null} [rows] FetchReportResultsResponse rows + * @property {string|null} [nextPageToken] FetchReportResultsResponse nextPageToken + */ + + /** + * Constructs a new FetchReportResultsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a FetchReportResultsResponse. + * @implements IFetchReportResultsResponse + * @constructor + * @param {google.cloud.channel.v1.IFetchReportResultsResponse=} [properties] Properties to set + */ + function FetchReportResultsResponse(properties) { + this.rows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchReportResultsResponse reportMetadata. + * @member {google.cloud.channel.v1.IReportResultsMetadata|null|undefined} reportMetadata + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @instance + */ + FetchReportResultsResponse.prototype.reportMetadata = null; + + /** + * FetchReportResultsResponse rows. + * @member {Array.} rows + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @instance + */ + FetchReportResultsResponse.prototype.rows = $util.emptyArray; + + /** + * FetchReportResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @instance + */ + FetchReportResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new FetchReportResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {google.cloud.channel.v1.IFetchReportResultsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.FetchReportResultsResponse} FetchReportResultsResponse instance + */ + FetchReportResultsResponse.create = function create(properties) { + return new FetchReportResultsResponse(properties); + }; + + /** + * Encodes the specified FetchReportResultsResponse message. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {google.cloud.channel.v1.IFetchReportResultsResponse} message FetchReportResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchReportResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reportMetadata != null && Object.hasOwnProperty.call(message, "reportMetadata")) + $root.google.cloud.channel.v1.ReportResultsMetadata.encode(message.reportMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.channel.v1.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified FetchReportResultsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.FetchReportResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {google.cloud.channel.v1.IFetchReportResultsResponse} message FetchReportResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchReportResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchReportResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.FetchReportResultsResponse} FetchReportResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchReportResultsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.FetchReportResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reportMetadata = $root.google.cloud.channel.v1.ReportResultsMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.channel.v1.Row.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchReportResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.FetchReportResultsResponse} FetchReportResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchReportResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchReportResultsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchReportResultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reportMetadata != null && message.hasOwnProperty("reportMetadata")) { + var error = $root.google.cloud.channel.v1.ReportResultsMetadata.verify(message.reportMetadata); + if (error) + return "reportMetadata." + error; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.channel.v1.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a FetchReportResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.FetchReportResultsResponse} FetchReportResultsResponse + */ + FetchReportResultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.FetchReportResultsResponse) + return object; + var message = new $root.google.cloud.channel.v1.FetchReportResultsResponse(); + if (object.reportMetadata != null) { + if (typeof object.reportMetadata !== "object") + throw TypeError(".google.cloud.channel.v1.FetchReportResultsResponse.reportMetadata: object expected"); + message.reportMetadata = $root.google.cloud.channel.v1.ReportResultsMetadata.fromObject(object.reportMetadata); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.channel.v1.FetchReportResultsResponse.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.channel.v1.FetchReportResultsResponse.rows: object expected"); + message.rows[i] = $root.google.cloud.channel.v1.Row.fromObject(object.rows[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a FetchReportResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {google.cloud.channel.v1.FetchReportResultsResponse} message FetchReportResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchReportResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) { + object.reportMetadata = null; + object.nextPageToken = ""; + } + if (message.reportMetadata != null && message.hasOwnProperty("reportMetadata")) + object.reportMetadata = $root.google.cloud.channel.v1.ReportResultsMetadata.toObject(message.reportMetadata, options); + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.channel.v1.Row.toObject(message.rows[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this FetchReportResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchReportResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchReportResultsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.FetchReportResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchReportResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.FetchReportResultsResponse"; + }; + + return FetchReportResultsResponse; + })(); + + v1.ListReportsRequest = (function() { + + /** + * Properties of a ListReportsRequest. + * @memberof google.cloud.channel.v1 + * @interface IListReportsRequest + * @property {string|null} [parent] ListReportsRequest parent + * @property {number|null} [pageSize] ListReportsRequest pageSize + * @property {string|null} [pageToken] ListReportsRequest pageToken + * @property {string|null} [languageCode] ListReportsRequest languageCode + */ + + /** + * Constructs a new ListReportsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListReportsRequest. + * @implements IListReportsRequest + * @constructor + * @param {google.cloud.channel.v1.IListReportsRequest=} [properties] Properties to set + */ + function ListReportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReportsRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListReportsRequest + * @instance + */ + ListReportsRequest.prototype.parent = ""; + + /** + * ListReportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListReportsRequest + * @instance + */ + ListReportsRequest.prototype.pageSize = 0; + + /** + * ListReportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListReportsRequest + * @instance + */ + ListReportsRequest.prototype.pageToken = ""; + + /** + * ListReportsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListReportsRequest + * @instance + */ + ListReportsRequest.prototype.languageCode = ""; + + /** + * Creates a new ListReportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {google.cloud.channel.v1.IListReportsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListReportsRequest} ListReportsRequest instance + */ + ListReportsRequest.create = function create(properties) { + return new ListReportsRequest(properties); + }; + + /** + * Encodes the specified ListReportsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {google.cloud.channel.v1.IListReportsRequest} message ListReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReportsRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListReportsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {google.cloud.channel.v1.IListReportsRequest} message ListReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListReportsRequest} ListReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReportsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListReportsRequest(); + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListReportsRequest} ListReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReportsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReportsRequest.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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListReportsRequest} ListReportsRequest + */ + ListReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListReportsRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListReportsRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {google.cloud.channel.v1.ListReportsRequest} message ListReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListReportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListReportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReportsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListReportsRequest"; + }; + + return ListReportsRequest; + })(); + + v1.ListReportsResponse = (function() { + + /** + * Properties of a ListReportsResponse. + * @memberof google.cloud.channel.v1 + * @interface IListReportsResponse + * @property {Array.|null} [reports] ListReportsResponse reports + * @property {string|null} [nextPageToken] ListReportsResponse nextPageToken + */ + + /** + * Constructs a new ListReportsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListReportsResponse. + * @implements IListReportsResponse + * @constructor + * @param {google.cloud.channel.v1.IListReportsResponse=} [properties] Properties to set + */ + function ListReportsResponse(properties) { + this.reports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReportsResponse reports. + * @member {Array.} reports + * @memberof google.cloud.channel.v1.ListReportsResponse + * @instance + */ + ListReportsResponse.prototype.reports = $util.emptyArray; + + /** + * ListReportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListReportsResponse + * @instance + */ + ListReportsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {google.cloud.channel.v1.IListReportsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListReportsResponse} ListReportsResponse instance + */ + ListReportsResponse.create = function create(properties) { + return new ListReportsResponse(properties); + }; + + /** + * Encodes the specified ListReportsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {google.cloud.channel.v1.IListReportsResponse} message ListReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reports != null && message.reports.length) + for (var i = 0; i < message.reports.length; ++i) + $root.google.cloud.channel.v1.Report.encode(message.reports[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListReportsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {google.cloud.channel.v1.IListReportsResponse} message ListReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListReportsResponse} ListReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReportsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reports && message.reports.length)) + message.reports = []; + message.reports.push($root.google.cloud.channel.v1.Report.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListReportsResponse} ListReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReportsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reports != null && message.hasOwnProperty("reports")) { + if (!Array.isArray(message.reports)) + return "reports: array expected"; + for (var i = 0; i < message.reports.length; ++i) { + var error = $root.google.cloud.channel.v1.Report.verify(message.reports[i]); + if (error) + return "reports." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListReportsResponse} ListReportsResponse + */ + ListReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListReportsResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListReportsResponse(); + if (object.reports) { + if (!Array.isArray(object.reports)) + throw TypeError(".google.cloud.channel.v1.ListReportsResponse.reports: array expected"); + message.reports = []; + for (var i = 0; i < object.reports.length; ++i) { + if (typeof object.reports[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListReportsResponse.reports: object expected"); + message.reports[i] = $root.google.cloud.channel.v1.Report.fromObject(object.reports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {google.cloud.channel.v1.ListReportsResponse} message ListReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reports = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.reports && message.reports.length) { + object.reports = []; + for (var j = 0; j < message.reports.length; ++j) + object.reports[j] = $root.google.cloud.channel.v1.Report.toObject(message.reports[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListReportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReportsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListReportsResponse"; + }; + + return ListReportsResponse; + })(); + + v1.ReportJob = (function() { + + /** + * Properties of a ReportJob. + * @memberof google.cloud.channel.v1 + * @interface IReportJob + * @property {string|null} [name] ReportJob name + * @property {google.cloud.channel.v1.IReportStatus|null} [reportStatus] ReportJob reportStatus + */ + + /** + * Constructs a new ReportJob. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ReportJob. + * @implements IReportJob + * @constructor + * @param {google.cloud.channel.v1.IReportJob=} [properties] Properties to set + */ + function ReportJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportJob name. + * @member {string} name + * @memberof google.cloud.channel.v1.ReportJob + * @instance + */ + ReportJob.prototype.name = ""; + + /** + * ReportJob reportStatus. + * @member {google.cloud.channel.v1.IReportStatus|null|undefined} reportStatus + * @memberof google.cloud.channel.v1.ReportJob + * @instance + */ + ReportJob.prototype.reportStatus = null; + + /** + * Creates a new ReportJob instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {google.cloud.channel.v1.IReportJob=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ReportJob} ReportJob instance + */ + ReportJob.create = function create(properties) { + return new ReportJob(properties); + }; + + /** + * Encodes the specified ReportJob message. Does not implicitly {@link google.cloud.channel.v1.ReportJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {google.cloud.channel.v1.IReportJob} message ReportJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportJob.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.reportStatus != null && Object.hasOwnProperty.call(message, "reportStatus")) + $root.google.cloud.channel.v1.ReportStatus.encode(message.reportStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReportJob message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {google.cloud.channel.v1.IReportJob} message ReportJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ReportJob} ReportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ReportJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reportStatus = $root.google.cloud.channel.v1.ReportStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ReportJob} ReportJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportJob message. + * @function verify + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportJob.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.reportStatus != null && message.hasOwnProperty("reportStatus")) { + var error = $root.google.cloud.channel.v1.ReportStatus.verify(message.reportStatus); + if (error) + return "reportStatus." + error; + } + return null; + }; + + /** + * Creates a ReportJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ReportJob} ReportJob + */ + ReportJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ReportJob) + return object; + var message = new $root.google.cloud.channel.v1.ReportJob(); + if (object.name != null) + message.name = String(object.name); + if (object.reportStatus != null) { + if (typeof object.reportStatus !== "object") + throw TypeError(".google.cloud.channel.v1.ReportJob.reportStatus: object expected"); + message.reportStatus = $root.google.cloud.channel.v1.ReportStatus.fromObject(object.reportStatus); + } + return message; + }; + + /** + * Creates a plain object from a ReportJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {google.cloud.channel.v1.ReportJob} message ReportJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reportStatus = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reportStatus != null && message.hasOwnProperty("reportStatus")) + object.reportStatus = $root.google.cloud.channel.v1.ReportStatus.toObject(message.reportStatus, options); + return object; + }; + + /** + * Converts this ReportJob to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ReportJob + * @instance + * @returns {Object.} JSON object + */ + ReportJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportJob + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ReportJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ReportJob"; + }; + + return ReportJob; + })(); + + v1.ReportResultsMetadata = (function() { + + /** + * Properties of a ReportResultsMetadata. + * @memberof google.cloud.channel.v1 + * @interface IReportResultsMetadata + * @property {google.cloud.channel.v1.IReport|null} [report] ReportResultsMetadata report + * @property {number|Long|null} [rowCount] ReportResultsMetadata rowCount + * @property {google.cloud.channel.v1.IDateRange|null} [dateRange] ReportResultsMetadata dateRange + * @property {google.cloud.channel.v1.IDateRange|null} [precedingDateRange] ReportResultsMetadata precedingDateRange + */ + + /** + * Constructs a new ReportResultsMetadata. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ReportResultsMetadata. + * @implements IReportResultsMetadata + * @constructor + * @param {google.cloud.channel.v1.IReportResultsMetadata=} [properties] Properties to set + */ + function ReportResultsMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportResultsMetadata report. + * @member {google.cloud.channel.v1.IReport|null|undefined} report + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @instance + */ + ReportResultsMetadata.prototype.report = null; + + /** + * ReportResultsMetadata rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @instance + */ + ReportResultsMetadata.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReportResultsMetadata dateRange. + * @member {google.cloud.channel.v1.IDateRange|null|undefined} dateRange + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @instance + */ + ReportResultsMetadata.prototype.dateRange = null; + + /** + * ReportResultsMetadata precedingDateRange. + * @member {google.cloud.channel.v1.IDateRange|null|undefined} precedingDateRange + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @instance + */ + ReportResultsMetadata.prototype.precedingDateRange = null; + + /** + * Creates a new ReportResultsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {google.cloud.channel.v1.IReportResultsMetadata=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ReportResultsMetadata} ReportResultsMetadata instance + */ + ReportResultsMetadata.create = function create(properties) { + return new ReportResultsMetadata(properties); + }; + + /** + * Encodes the specified ReportResultsMetadata message. Does not implicitly {@link google.cloud.channel.v1.ReportResultsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {google.cloud.channel.v1.IReportResultsMetadata} message ReportResultsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportResultsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.report != null && Object.hasOwnProperty.call(message, "report")) + $root.google.cloud.channel.v1.Report.encode(message.report, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + if (message.dateRange != null && Object.hasOwnProperty.call(message, "dateRange")) + $root.google.cloud.channel.v1.DateRange.encode(message.dateRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.precedingDateRange != null && Object.hasOwnProperty.call(message, "precedingDateRange")) + $root.google.cloud.channel.v1.DateRange.encode(message.precedingDateRange, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReportResultsMetadata message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportResultsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {google.cloud.channel.v1.IReportResultsMetadata} message ReportResultsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportResultsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportResultsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ReportResultsMetadata} ReportResultsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportResultsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ReportResultsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.report = $root.google.cloud.channel.v1.Report.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rowCount = reader.int64(); + break; + } + case 3: { + message.dateRange = $root.google.cloud.channel.v1.DateRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.precedingDateRange = $root.google.cloud.channel.v1.DateRange.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportResultsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ReportResultsMetadata} ReportResultsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportResultsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportResultsMetadata message. + * @function verify + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportResultsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.report != null && message.hasOwnProperty("report")) { + var error = $root.google.cloud.channel.v1.Report.verify(message.report); + if (error) + return "report." + error; + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + if (message.dateRange != null && message.hasOwnProperty("dateRange")) { + var error = $root.google.cloud.channel.v1.DateRange.verify(message.dateRange); + if (error) + return "dateRange." + error; + } + if (message.precedingDateRange != null && message.hasOwnProperty("precedingDateRange")) { + var error = $root.google.cloud.channel.v1.DateRange.verify(message.precedingDateRange); + if (error) + return "precedingDateRange." + error; + } + return null; + }; + + /** + * Creates a ReportResultsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ReportResultsMetadata} ReportResultsMetadata + */ + ReportResultsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ReportResultsMetadata) + return object; + var message = new $root.google.cloud.channel.v1.ReportResultsMetadata(); + if (object.report != null) { + if (typeof object.report !== "object") + throw TypeError(".google.cloud.channel.v1.ReportResultsMetadata.report: object expected"); + message.report = $root.google.cloud.channel.v1.Report.fromObject(object.report); + } + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + if (object.dateRange != null) { + if (typeof object.dateRange !== "object") + throw TypeError(".google.cloud.channel.v1.ReportResultsMetadata.dateRange: object expected"); + message.dateRange = $root.google.cloud.channel.v1.DateRange.fromObject(object.dateRange); + } + if (object.precedingDateRange != null) { + if (typeof object.precedingDateRange !== "object") + throw TypeError(".google.cloud.channel.v1.ReportResultsMetadata.precedingDateRange: object expected"); + message.precedingDateRange = $root.google.cloud.channel.v1.DateRange.fromObject(object.precedingDateRange); + } + return message; + }; + + /** + * Creates a plain object from a ReportResultsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {google.cloud.channel.v1.ReportResultsMetadata} message ReportResultsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportResultsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.report = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + object.dateRange = null; + object.precedingDateRange = null; + } + if (message.report != null && message.hasOwnProperty("report")) + object.report = $root.google.cloud.channel.v1.Report.toObject(message.report, options); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + if (message.dateRange != null && message.hasOwnProperty("dateRange")) + object.dateRange = $root.google.cloud.channel.v1.DateRange.toObject(message.dateRange, options); + if (message.precedingDateRange != null && message.hasOwnProperty("precedingDateRange")) + object.precedingDateRange = $root.google.cloud.channel.v1.DateRange.toObject(message.precedingDateRange, options); + return object; + }; + + /** + * Converts this ReportResultsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @instance + * @returns {Object.} JSON object + */ + ReportResultsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportResultsMetadata + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ReportResultsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportResultsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ReportResultsMetadata"; + }; + + return ReportResultsMetadata; + })(); + + v1.Column = (function() { + + /** + * Properties of a Column. + * @memberof google.cloud.channel.v1 + * @interface IColumn + * @property {string|null} [columnId] Column columnId + * @property {string|null} [displayName] Column displayName + * @property {google.cloud.channel.v1.Column.DataType|null} [dataType] Column dataType + */ + + /** + * Constructs a new Column. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Column. + * @implements IColumn + * @constructor + * @param {google.cloud.channel.v1.IColumn=} [properties] Properties to set + */ + function Column(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Column columnId. + * @member {string} columnId + * @memberof google.cloud.channel.v1.Column + * @instance + */ + Column.prototype.columnId = ""; + + /** + * Column displayName. + * @member {string} displayName + * @memberof google.cloud.channel.v1.Column + * @instance + */ + Column.prototype.displayName = ""; + + /** + * Column dataType. + * @member {google.cloud.channel.v1.Column.DataType} dataType + * @memberof google.cloud.channel.v1.Column + * @instance + */ + Column.prototype.dataType = 0; + + /** + * Creates a new Column instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Column + * @static + * @param {google.cloud.channel.v1.IColumn=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Column} Column instance + */ + Column.create = function create(properties) { + return new Column(properties); + }; + + /** + * Encodes the specified Column message. Does not implicitly {@link google.cloud.channel.v1.Column.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Column + * @static + * @param {google.cloud.channel.v1.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnId != null && Object.hasOwnProperty.call(message, "columnId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + return writer; + }; + + /** + * Encodes the specified Column message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Column.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Column + * @static + * @param {google.cloud.channel.v1.IColumn} message Column message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Column.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Column message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Column(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnId = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Column message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Column + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Column} Column + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Column.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Column message. + * @function verify + * @memberof google.cloud.channel.v1.Column + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Column.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnId != null && message.hasOwnProperty("columnId")) + if (!$util.isString(message.columnId)) + return "columnId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Column message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Column + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Column} Column + */ + Column.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Column) + return object; + var message = new $root.google.cloud.channel.v1.Column(); + if (object.columnId != null) + message.columnId = String(object.columnId); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "STRING": + case 1: + message.dataType = 1; + break; + case "INT": + case 2: + message.dataType = 2; + break; + case "DECIMAL": + case 3: + message.dataType = 3; + break; + case "MONEY": + case 4: + message.dataType = 4; + break; + case "DATE": + case 5: + message.dataType = 5; + break; + case "DATE_TIME": + case 6: + message.dataType = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Column message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Column + * @static + * @param {google.cloud.channel.v1.Column} message Column + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Column.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnId = ""; + object.displayName = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + } + if (message.columnId != null && message.hasOwnProperty("columnId")) + object.columnId = message.columnId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.channel.v1.Column.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.channel.v1.Column.DataType[message.dataType] : message.dataType; + return object; + }; + + /** + * Converts this Column to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Column + * @instance + * @returns {Object.} JSON object + */ + Column.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Column + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Column + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Column.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Column"; + }; + + /** + * DataType enum. + * @name google.cloud.channel.v1.Column.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INT=2 INT value + * @property {number} DECIMAL=3 DECIMAL value + * @property {number} MONEY=4 MONEY value + * @property {number} DATE=5 DATE value + * @property {number} DATE_TIME=6 DATE_TIME value + */ + Column.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INT"] = 2; + values[valuesById[3] = "DECIMAL"] = 3; + values[valuesById[4] = "MONEY"] = 4; + values[valuesById[5] = "DATE"] = 5; + values[valuesById[6] = "DATE_TIME"] = 6; + return values; + })(); + + return Column; + })(); + + v1.DateRange = (function() { + + /** + * Properties of a DateRange. + * @memberof google.cloud.channel.v1 + * @interface IDateRange + * @property {google.type.IDateTime|null} [usageStartDateTime] DateRange usageStartDateTime + * @property {google.type.IDateTime|null} [usageEndDateTime] DateRange usageEndDateTime + * @property {google.type.IDate|null} [invoiceStartDate] DateRange invoiceStartDate + * @property {google.type.IDate|null} [invoiceEndDate] DateRange invoiceEndDate + */ + + /** + * Constructs a new DateRange. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a DateRange. + * @implements IDateRange + * @constructor + * @param {google.cloud.channel.v1.IDateRange=} [properties] Properties to set + */ + function DateRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateRange usageStartDateTime. + * @member {google.type.IDateTime|null|undefined} usageStartDateTime + * @memberof google.cloud.channel.v1.DateRange + * @instance + */ + DateRange.prototype.usageStartDateTime = null; + + /** + * DateRange usageEndDateTime. + * @member {google.type.IDateTime|null|undefined} usageEndDateTime + * @memberof google.cloud.channel.v1.DateRange + * @instance + */ + DateRange.prototype.usageEndDateTime = null; + + /** + * DateRange invoiceStartDate. + * @member {google.type.IDate|null|undefined} invoiceStartDate + * @memberof google.cloud.channel.v1.DateRange + * @instance + */ + DateRange.prototype.invoiceStartDate = null; + + /** + * DateRange invoiceEndDate. + * @member {google.type.IDate|null|undefined} invoiceEndDate + * @memberof google.cloud.channel.v1.DateRange + * @instance + */ + DateRange.prototype.invoiceEndDate = null; + + /** + * Creates a new DateRange instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {google.cloud.channel.v1.IDateRange=} [properties] Properties to set + * @returns {google.cloud.channel.v1.DateRange} DateRange instance + */ + DateRange.create = function create(properties) { + return new DateRange(properties); + }; + + /** + * Encodes the specified DateRange message. Does not implicitly {@link google.cloud.channel.v1.DateRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {google.cloud.channel.v1.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.usageStartDateTime != null && Object.hasOwnProperty.call(message, "usageStartDateTime")) + $root.google.type.DateTime.encode(message.usageStartDateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.usageEndDateTime != null && Object.hasOwnProperty.call(message, "usageEndDateTime")) + $root.google.type.DateTime.encode(message.usageEndDateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.invoiceStartDate != null && Object.hasOwnProperty.call(message, "invoiceStartDate")) + $root.google.type.Date.encode(message.invoiceStartDate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.invoiceEndDate != null && Object.hasOwnProperty.call(message, "invoiceEndDate")) + $root.google.type.Date.encode(message.invoiceEndDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateRange message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DateRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {google.cloud.channel.v1.IDateRange} message DateRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.DateRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.usageStartDateTime = $root.google.type.DateTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.usageEndDateTime = $root.google.type.DateTime.decode(reader, reader.uint32()); + break; + } + case 3: { + message.invoiceStartDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 4: { + message.invoiceEndDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.DateRange} DateRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateRange message. + * @function verify + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.usageStartDateTime != null && message.hasOwnProperty("usageStartDateTime")) { + var error = $root.google.type.DateTime.verify(message.usageStartDateTime); + if (error) + return "usageStartDateTime." + error; + } + if (message.usageEndDateTime != null && message.hasOwnProperty("usageEndDateTime")) { + var error = $root.google.type.DateTime.verify(message.usageEndDateTime); + if (error) + return "usageEndDateTime." + error; + } + if (message.invoiceStartDate != null && message.hasOwnProperty("invoiceStartDate")) { + var error = $root.google.type.Date.verify(message.invoiceStartDate); + if (error) + return "invoiceStartDate." + error; + } + if (message.invoiceEndDate != null && message.hasOwnProperty("invoiceEndDate")) { + var error = $root.google.type.Date.verify(message.invoiceEndDate); + if (error) + return "invoiceEndDate." + error; + } + return null; + }; + + /** + * Creates a DateRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.DateRange} DateRange + */ + DateRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.DateRange) + return object; + var message = new $root.google.cloud.channel.v1.DateRange(); + if (object.usageStartDateTime != null) { + if (typeof object.usageStartDateTime !== "object") + throw TypeError(".google.cloud.channel.v1.DateRange.usageStartDateTime: object expected"); + message.usageStartDateTime = $root.google.type.DateTime.fromObject(object.usageStartDateTime); + } + if (object.usageEndDateTime != null) { + if (typeof object.usageEndDateTime !== "object") + throw TypeError(".google.cloud.channel.v1.DateRange.usageEndDateTime: object expected"); + message.usageEndDateTime = $root.google.type.DateTime.fromObject(object.usageEndDateTime); + } + if (object.invoiceStartDate != null) { + if (typeof object.invoiceStartDate !== "object") + throw TypeError(".google.cloud.channel.v1.DateRange.invoiceStartDate: object expected"); + message.invoiceStartDate = $root.google.type.Date.fromObject(object.invoiceStartDate); + } + if (object.invoiceEndDate != null) { + if (typeof object.invoiceEndDate !== "object") + throw TypeError(".google.cloud.channel.v1.DateRange.invoiceEndDate: object expected"); + message.invoiceEndDate = $root.google.type.Date.fromObject(object.invoiceEndDate); + } + return message; + }; + + /** + * Creates a plain object from a DateRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {google.cloud.channel.v1.DateRange} message DateRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.usageStartDateTime = null; + object.usageEndDateTime = null; + object.invoiceStartDate = null; + object.invoiceEndDate = null; + } + if (message.usageStartDateTime != null && message.hasOwnProperty("usageStartDateTime")) + object.usageStartDateTime = $root.google.type.DateTime.toObject(message.usageStartDateTime, options); + if (message.usageEndDateTime != null && message.hasOwnProperty("usageEndDateTime")) + object.usageEndDateTime = $root.google.type.DateTime.toObject(message.usageEndDateTime, options); + if (message.invoiceStartDate != null && message.hasOwnProperty("invoiceStartDate")) + object.invoiceStartDate = $root.google.type.Date.toObject(message.invoiceStartDate, options); + if (message.invoiceEndDate != null && message.hasOwnProperty("invoiceEndDate")) + object.invoiceEndDate = $root.google.type.Date.toObject(message.invoiceEndDate, options); + return object; + }; + + /** + * Converts this DateRange to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.DateRange + * @instance + * @returns {Object.} JSON object + */ + DateRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateRange + * @function getTypeUrl + * @memberof google.cloud.channel.v1.DateRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.DateRange"; + }; + + return DateRange; + })(); + + v1.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.channel.v1 + * @interface IRow + * @property {Array.|null} [values] Row values + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.channel.v1.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row values. + * @member {Array.} values + * @memberof google.cloud.channel.v1.Row + * @instance + */ + Row.prototype.values = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Row + * @static + * @param {google.cloud.channel.v1.IRow=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.channel.v1.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Row + * @static + * @param {google.cloud.channel.v1.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.channel.v1.ReportValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Row + * @static + * @param {google.cloud.channel.v1.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.channel.v1.ReportValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.channel.v1.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.channel.v1.ReportValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Row) + return object; + var message = new $root.google.cloud.channel.v1.Row(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.channel.v1.Row.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.channel.v1.Row.values: object expected"); + message.values[i] = $root.google.cloud.channel.v1.ReportValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Row + * @static + * @param {google.cloud.channel.v1.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.channel.v1.ReportValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Row"; + }; + + return Row; + })(); + + v1.ReportValue = (function() { + + /** + * Properties of a ReportValue. + * @memberof google.cloud.channel.v1 + * @interface IReportValue + * @property {string|null} [stringValue] ReportValue stringValue + * @property {number|Long|null} [intValue] ReportValue intValue + * @property {google.type.IDecimal|null} [decimalValue] ReportValue decimalValue + * @property {google.type.IMoney|null} [moneyValue] ReportValue moneyValue + * @property {google.type.IDate|null} [dateValue] ReportValue dateValue + * @property {google.type.IDateTime|null} [dateTimeValue] ReportValue dateTimeValue + */ + + /** + * Constructs a new ReportValue. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ReportValue. + * @implements IReportValue + * @constructor + * @param {google.cloud.channel.v1.IReportValue=} [properties] Properties to set + */ + function ReportValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportValue stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + ReportValue.prototype.stringValue = null; + + /** + * ReportValue intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + ReportValue.prototype.intValue = null; + + /** + * ReportValue decimalValue. + * @member {google.type.IDecimal|null|undefined} decimalValue + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + ReportValue.prototype.decimalValue = null; + + /** + * ReportValue moneyValue. + * @member {google.type.IMoney|null|undefined} moneyValue + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + ReportValue.prototype.moneyValue = null; + + /** + * ReportValue dateValue. + * @member {google.type.IDate|null|undefined} dateValue + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + ReportValue.prototype.dateValue = null; + + /** + * ReportValue dateTimeValue. + * @member {google.type.IDateTime|null|undefined} dateTimeValue + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + ReportValue.prototype.dateTimeValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReportValue value. + * @member {"stringValue"|"intValue"|"decimalValue"|"moneyValue"|"dateValue"|"dateTimeValue"|undefined} value + * @memberof google.cloud.channel.v1.ReportValue + * @instance + */ + Object.defineProperty(ReportValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["stringValue", "intValue", "decimalValue", "moneyValue", "dateValue", "dateTimeValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReportValue instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {google.cloud.channel.v1.IReportValue=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ReportValue} ReportValue instance + */ + ReportValue.create = function create(properties) { + return new ReportValue(properties); + }; + + /** + * Encodes the specified ReportValue message. Does not implicitly {@link google.cloud.channel.v1.ReportValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {google.cloud.channel.v1.IReportValue} message ReportValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.intValue); + if (message.decimalValue != null && Object.hasOwnProperty.call(message, "decimalValue")) + $root.google.type.Decimal.encode(message.decimalValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.moneyValue != null && Object.hasOwnProperty.call(message, "moneyValue")) + $root.google.type.Money.encode(message.moneyValue, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.dateValue != null && Object.hasOwnProperty.call(message, "dateValue")) + $root.google.type.Date.encode(message.dateValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.dateTimeValue != null && Object.hasOwnProperty.call(message, "dateTimeValue")) + $root.google.type.DateTime.encode(message.dateTimeValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReportValue message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {google.cloud.channel.v1.IReportValue} message ReportValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ReportValue} ReportValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ReportValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stringValue = reader.string(); + break; + } + case 2: { + message.intValue = reader.int64(); + break; + } + case 3: { + message.decimalValue = $root.google.type.Decimal.decode(reader, reader.uint32()); + break; + } + case 4: { + message.moneyValue = $root.google.type.Money.decode(reader, reader.uint32()); + break; + } + case 5: { + message.dateValue = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 6: { + message.dateTimeValue = $root.google.type.DateTime.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ReportValue} ReportValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportValue message. + * @function verify + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.decimalValue != null && message.hasOwnProperty("decimalValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.type.Decimal.verify(message.decimalValue); + if (error) + return "decimalValue." + error; + } + } + if (message.moneyValue != null && message.hasOwnProperty("moneyValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.type.Money.verify(message.moneyValue); + if (error) + return "moneyValue." + error; + } + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.type.Date.verify(message.dateValue); + if (error) + return "dateValue." + error; + } + } + if (message.dateTimeValue != null && message.hasOwnProperty("dateTimeValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.type.DateTime.verify(message.dateTimeValue); + if (error) + return "dateTimeValue." + error; + } + } + return null; + }; + + /** + * Creates a ReportValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ReportValue} ReportValue + */ + ReportValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ReportValue) + return object; + var message = new $root.google.cloud.channel.v1.ReportValue(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.decimalValue != null) { + if (typeof object.decimalValue !== "object") + throw TypeError(".google.cloud.channel.v1.ReportValue.decimalValue: object expected"); + message.decimalValue = $root.google.type.Decimal.fromObject(object.decimalValue); + } + if (object.moneyValue != null) { + if (typeof object.moneyValue !== "object") + throw TypeError(".google.cloud.channel.v1.ReportValue.moneyValue: object expected"); + message.moneyValue = $root.google.type.Money.fromObject(object.moneyValue); + } + if (object.dateValue != null) { + if (typeof object.dateValue !== "object") + throw TypeError(".google.cloud.channel.v1.ReportValue.dateValue: object expected"); + message.dateValue = $root.google.type.Date.fromObject(object.dateValue); + } + if (object.dateTimeValue != null) { + if (typeof object.dateTimeValue !== "object") + throw TypeError(".google.cloud.channel.v1.ReportValue.dateTimeValue: object expected"); + message.dateTimeValue = $root.google.type.DateTime.fromObject(object.dateTimeValue); + } + return message; + }; + + /** + * Creates a plain object from a ReportValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {google.cloud.channel.v1.ReportValue} message ReportValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.value = "intValue"; + } + if (message.decimalValue != null && message.hasOwnProperty("decimalValue")) { + object.decimalValue = $root.google.type.Decimal.toObject(message.decimalValue, options); + if (options.oneofs) + object.value = "decimalValue"; + } + if (message.moneyValue != null && message.hasOwnProperty("moneyValue")) { + object.moneyValue = $root.google.type.Money.toObject(message.moneyValue, options); + if (options.oneofs) + object.value = "moneyValue"; + } + if (message.dateValue != null && message.hasOwnProperty("dateValue")) { + object.dateValue = $root.google.type.Date.toObject(message.dateValue, options); + if (options.oneofs) + object.value = "dateValue"; + } + if (message.dateTimeValue != null && message.hasOwnProperty("dateTimeValue")) { + object.dateTimeValue = $root.google.type.DateTime.toObject(message.dateTimeValue, options); + if (options.oneofs) + object.value = "dateTimeValue"; + } + return object; + }; + + /** + * Converts this ReportValue to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ReportValue + * @instance + * @returns {Object.} JSON object + */ + ReportValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportValue + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ReportValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ReportValue"; + }; + + return ReportValue; + })(); + + v1.ReportStatus = (function() { + + /** + * Properties of a ReportStatus. + * @memberof google.cloud.channel.v1 + * @interface IReportStatus + * @property {google.cloud.channel.v1.ReportStatus.State|null} [state] ReportStatus state + * @property {google.protobuf.ITimestamp|null} [startTime] ReportStatus startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ReportStatus endTime + */ + + /** + * Constructs a new ReportStatus. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ReportStatus. + * @implements IReportStatus + * @constructor + * @param {google.cloud.channel.v1.IReportStatus=} [properties] Properties to set + */ + function ReportStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportStatus state. + * @member {google.cloud.channel.v1.ReportStatus.State} state + * @memberof google.cloud.channel.v1.ReportStatus + * @instance + */ + ReportStatus.prototype.state = 0; + + /** + * ReportStatus startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.channel.v1.ReportStatus + * @instance + */ + ReportStatus.prototype.startTime = null; + + /** + * ReportStatus endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.channel.v1.ReportStatus + * @instance + */ + ReportStatus.prototype.endTime = null; + + /** + * Creates a new ReportStatus instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {google.cloud.channel.v1.IReportStatus=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ReportStatus} ReportStatus instance + */ + ReportStatus.create = function create(properties) { + return new ReportStatus(properties); + }; + + /** + * Encodes the specified ReportStatus message. Does not implicitly {@link google.cloud.channel.v1.ReportStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {google.cloud.channel.v1.IReportStatus} message ReportStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReportStatus message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ReportStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {google.cloud.channel.v1.IReportStatus} message ReportStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ReportStatus} ReportStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ReportStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ReportStatus} ReportStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportStatus message. + * @function verify + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a ReportStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ReportStatus} ReportStatus + */ + ReportStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ReportStatus) + return object; + var message = new $root.google.cloud.channel.v1.ReportStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STARTED": + case 1: + message.state = 1; + break; + case "WRITING": + case 2: + message.state = 2; + break; + case "AVAILABLE": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.channel.v1.ReportStatus.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.channel.v1.ReportStatus.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a ReportStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {google.cloud.channel.v1.ReportStatus} message ReportStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.startTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.channel.v1.ReportStatus.State[message.state] === undefined ? message.state : $root.google.cloud.channel.v1.ReportStatus.State[message.state] : message.state; + 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); + return object; + }; + + /** + * Converts this ReportStatus to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ReportStatus + * @instance + * @returns {Object.} JSON object + */ + ReportStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportStatus + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ReportStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ReportStatus"; + }; + + /** + * State enum. + * @name google.cloud.channel.v1.ReportStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STARTED=1 STARTED value + * @property {number} WRITING=2 WRITING value + * @property {number} AVAILABLE=3 AVAILABLE value + * @property {number} FAILED=4 FAILED value + */ + ReportStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STARTED"] = 1; + values[valuesById[2] = "WRITING"] = 2; + values[valuesById[3] = "AVAILABLE"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return ReportStatus; + })(); + + v1.Report = (function() { + + /** + * Properties of a Report. + * @memberof google.cloud.channel.v1 + * @interface IReport + * @property {string|null} [name] Report name + * @property {string|null} [displayName] Report displayName + * @property {Array.|null} [columns] Report columns + * @property {string|null} [description] Report description + */ + + /** + * Constructs a new Report. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a Report. + * @implements IReport + * @constructor + * @param {google.cloud.channel.v1.IReport=} [properties] Properties to set + */ + function Report(properties) { + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Report name. + * @member {string} name + * @memberof google.cloud.channel.v1.Report + * @instance + */ + Report.prototype.name = ""; + + /** + * Report displayName. + * @member {string} displayName + * @memberof google.cloud.channel.v1.Report + * @instance + */ + Report.prototype.displayName = ""; + + /** + * Report columns. + * @member {Array.} columns + * @memberof google.cloud.channel.v1.Report + * @instance + */ + Report.prototype.columns = $util.emptyArray; + + /** + * Report description. + * @member {string} description + * @memberof google.cloud.channel.v1.Report + * @instance + */ + Report.prototype.description = ""; + + /** + * Creates a new Report instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.Report + * @static + * @param {google.cloud.channel.v1.IReport=} [properties] Properties to set + * @returns {google.cloud.channel.v1.Report} Report instance + */ + Report.create = function create(properties) { + return new Report(properties); + }; + + /** + * Encodes the specified Report message. Does not implicitly {@link google.cloud.channel.v1.Report.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.Report + * @static + * @param {google.cloud.channel.v1.IReport} message Report message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Report.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.channel.v1.Column.encode(message.columns[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + return writer; + }; + + /** + * Encodes the specified Report message, length delimited. Does not implicitly {@link google.cloud.channel.v1.Report.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.Report + * @static + * @param {google.cloud.channel.v1.IReport} message Report message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Report.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Report message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.Report + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.Report} Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Report.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.Report(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.channel.v1.Column.decode(reader, reader.uint32())); + break; + } + case 4: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Report message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.Report + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.Report} Report + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Report.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Report message. + * @function verify + * @memberof google.cloud.channel.v1.Report + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Report.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.channel.v1.Column.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Report message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.Report + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.Report} Report + */ + Report.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.Report) + return object; + var message = new $root.google.cloud.channel.v1.Report(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.channel.v1.Report.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.cloud.channel.v1.Report.columns: object expected"); + message.columns[i] = $root.google.cloud.channel.v1.Column.fromObject(object.columns[i]); + } + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Report message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.Report + * @static + * @param {google.cloud.channel.v1.Report} message Report + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Report.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columns = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.channel.v1.Column.toObject(message.columns[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Report to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.Report + * @instance + * @returns {Object.} JSON object + */ + Report.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Report + * @function getTypeUrl + * @memberof google.cloud.channel.v1.Report + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Report.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.Report"; + }; + + return Report; + })(); + + /** + * RebillingBasis enum. + * @name google.cloud.channel.v1.RebillingBasis + * @enum {number} + * @property {number} REBILLING_BASIS_UNSPECIFIED=0 REBILLING_BASIS_UNSPECIFIED value + * @property {number} COST_AT_LIST=1 COST_AT_LIST value + * @property {number} DIRECT_CUSTOMER_COST=2 DIRECT_CUSTOMER_COST value + */ + v1.RebillingBasis = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REBILLING_BASIS_UNSPECIFIED"] = 0; + values[valuesById[1] = "COST_AT_LIST"] = 1; + values[valuesById[2] = "DIRECT_CUSTOMER_COST"] = 2; + return values; + })(); + + v1.CustomerRepricingConfig = (function() { + + /** + * Properties of a CustomerRepricingConfig. + * @memberof google.cloud.channel.v1 + * @interface ICustomerRepricingConfig + * @property {string|null} [name] CustomerRepricingConfig name + * @property {google.cloud.channel.v1.IRepricingConfig|null} [repricingConfig] CustomerRepricingConfig repricingConfig + * @property {google.protobuf.ITimestamp|null} [updateTime] CustomerRepricingConfig updateTime + */ + + /** + * Constructs a new CustomerRepricingConfig. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CustomerRepricingConfig. + * @implements ICustomerRepricingConfig + * @constructor + * @param {google.cloud.channel.v1.ICustomerRepricingConfig=} [properties] Properties to set + */ + function CustomerRepricingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerRepricingConfig name. + * @member {string} name + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @instance + */ + CustomerRepricingConfig.prototype.name = ""; + + /** + * CustomerRepricingConfig repricingConfig. + * @member {google.cloud.channel.v1.IRepricingConfig|null|undefined} repricingConfig + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @instance + */ + CustomerRepricingConfig.prototype.repricingConfig = null; + + /** + * CustomerRepricingConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @instance + */ + CustomerRepricingConfig.prototype.updateTime = null; + + /** + * Creates a new CustomerRepricingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {google.cloud.channel.v1.ICustomerRepricingConfig=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CustomerRepricingConfig} CustomerRepricingConfig instance + */ + CustomerRepricingConfig.create = function create(properties) { + return new CustomerRepricingConfig(properties); + }; + + /** + * Encodes the specified CustomerRepricingConfig message. Does not implicitly {@link google.cloud.channel.v1.CustomerRepricingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {google.cloud.channel.v1.ICustomerRepricingConfig} message CustomerRepricingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerRepricingConfig.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.repricingConfig != null && Object.hasOwnProperty.call(message, "repricingConfig")) + $root.google.cloud.channel.v1.RepricingConfig.encode(message.repricingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomerRepricingConfig message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CustomerRepricingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {google.cloud.channel.v1.ICustomerRepricingConfig} message CustomerRepricingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerRepricingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerRepricingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CustomerRepricingConfig} CustomerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerRepricingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CustomerRepricingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.repricingConfig = $root.google.cloud.channel.v1.RepricingConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerRepricingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CustomerRepricingConfig} CustomerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerRepricingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerRepricingConfig message. + * @function verify + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerRepricingConfig.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.repricingConfig != null && message.hasOwnProperty("repricingConfig")) { + var error = $root.google.cloud.channel.v1.RepricingConfig.verify(message.repricingConfig); + if (error) + return "repricingConfig." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a CustomerRepricingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CustomerRepricingConfig} CustomerRepricingConfig + */ + CustomerRepricingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CustomerRepricingConfig) + return object; + var message = new $root.google.cloud.channel.v1.CustomerRepricingConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.repricingConfig != null) { + if (typeof object.repricingConfig !== "object") + throw TypeError(".google.cloud.channel.v1.CustomerRepricingConfig.repricingConfig: object expected"); + message.repricingConfig = $root.google.cloud.channel.v1.RepricingConfig.fromObject(object.repricingConfig); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.channel.v1.CustomerRepricingConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a CustomerRepricingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {google.cloud.channel.v1.CustomerRepricingConfig} message CustomerRepricingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerRepricingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.repricingConfig = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.repricingConfig != null && message.hasOwnProperty("repricingConfig")) + object.repricingConfig = $root.google.cloud.channel.v1.RepricingConfig.toObject(message.repricingConfig, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this CustomerRepricingConfig to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @instance + * @returns {Object.} JSON object + */ + CustomerRepricingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerRepricingConfig + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CustomerRepricingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerRepricingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CustomerRepricingConfig"; + }; + + return CustomerRepricingConfig; + })(); + + v1.ChannelPartnerRepricingConfig = (function() { + + /** + * Properties of a ChannelPartnerRepricingConfig. + * @memberof google.cloud.channel.v1 + * @interface IChannelPartnerRepricingConfig + * @property {string|null} [name] ChannelPartnerRepricingConfig name + * @property {google.cloud.channel.v1.IRepricingConfig|null} [repricingConfig] ChannelPartnerRepricingConfig repricingConfig + * @property {google.protobuf.ITimestamp|null} [updateTime] ChannelPartnerRepricingConfig updateTime + */ + + /** + * Constructs a new ChannelPartnerRepricingConfig. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ChannelPartnerRepricingConfig. + * @implements IChannelPartnerRepricingConfig + * @constructor + * @param {google.cloud.channel.v1.IChannelPartnerRepricingConfig=} [properties] Properties to set + */ + function ChannelPartnerRepricingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelPartnerRepricingConfig name. + * @member {string} name + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @instance + */ + ChannelPartnerRepricingConfig.prototype.name = ""; + + /** + * ChannelPartnerRepricingConfig repricingConfig. + * @member {google.cloud.channel.v1.IRepricingConfig|null|undefined} repricingConfig + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @instance + */ + ChannelPartnerRepricingConfig.prototype.repricingConfig = null; + + /** + * ChannelPartnerRepricingConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @instance + */ + ChannelPartnerRepricingConfig.prototype.updateTime = null; + + /** + * Creates a new ChannelPartnerRepricingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {google.cloud.channel.v1.IChannelPartnerRepricingConfig=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ChannelPartnerRepricingConfig} ChannelPartnerRepricingConfig instance + */ + ChannelPartnerRepricingConfig.create = function create(properties) { + return new ChannelPartnerRepricingConfig(properties); + }; + + /** + * Encodes the specified ChannelPartnerRepricingConfig message. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {google.cloud.channel.v1.IChannelPartnerRepricingConfig} message ChannelPartnerRepricingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelPartnerRepricingConfig.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.repricingConfig != null && Object.hasOwnProperty.call(message, "repricingConfig")) + $root.google.cloud.channel.v1.RepricingConfig.encode(message.repricingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChannelPartnerRepricingConfig message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {google.cloud.channel.v1.IChannelPartnerRepricingConfig} message ChannelPartnerRepricingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelPartnerRepricingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelPartnerRepricingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ChannelPartnerRepricingConfig} ChannelPartnerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelPartnerRepricingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.repricingConfig = $root.google.cloud.channel.v1.RepricingConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelPartnerRepricingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ChannelPartnerRepricingConfig} ChannelPartnerRepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelPartnerRepricingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelPartnerRepricingConfig message. + * @function verify + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelPartnerRepricingConfig.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.repricingConfig != null && message.hasOwnProperty("repricingConfig")) { + var error = $root.google.cloud.channel.v1.RepricingConfig.verify(message.repricingConfig); + if (error) + return "repricingConfig." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a ChannelPartnerRepricingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ChannelPartnerRepricingConfig} ChannelPartnerRepricingConfig + */ + ChannelPartnerRepricingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig) + return object; + var message = new $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.repricingConfig != null) { + if (typeof object.repricingConfig !== "object") + throw TypeError(".google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricingConfig: object expected"); + message.repricingConfig = $root.google.cloud.channel.v1.RepricingConfig.fromObject(object.repricingConfig); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.channel.v1.ChannelPartnerRepricingConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a ChannelPartnerRepricingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {google.cloud.channel.v1.ChannelPartnerRepricingConfig} message ChannelPartnerRepricingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelPartnerRepricingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.repricingConfig = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.repricingConfig != null && message.hasOwnProperty("repricingConfig")) + object.repricingConfig = $root.google.cloud.channel.v1.RepricingConfig.toObject(message.repricingConfig, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this ChannelPartnerRepricingConfig to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @instance + * @returns {Object.} JSON object + */ + ChannelPartnerRepricingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelPartnerRepricingConfig + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ChannelPartnerRepricingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelPartnerRepricingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ChannelPartnerRepricingConfig"; + }; + + return ChannelPartnerRepricingConfig; + })(); + + v1.RepricingConfig = (function() { + + /** + * Properties of a RepricingConfig. + * @memberof google.cloud.channel.v1 + * @interface IRepricingConfig + * @property {google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity|null} [entitlementGranularity] RepricingConfig entitlementGranularity + * @property {google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity|null} [channelPartnerGranularity] RepricingConfig channelPartnerGranularity + * @property {google.type.IDate|null} [effectiveInvoiceMonth] RepricingConfig effectiveInvoiceMonth + * @property {google.cloud.channel.v1.IRepricingAdjustment|null} [adjustment] RepricingConfig adjustment + * @property {google.cloud.channel.v1.RebillingBasis|null} [rebillingBasis] RepricingConfig rebillingBasis + */ + + /** + * Constructs a new RepricingConfig. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RepricingConfig. + * @implements IRepricingConfig + * @constructor + * @param {google.cloud.channel.v1.IRepricingConfig=} [properties] Properties to set + */ + function RepricingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepricingConfig entitlementGranularity. + * @member {google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity|null|undefined} entitlementGranularity + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.entitlementGranularity = null; + + /** + * RepricingConfig channelPartnerGranularity. + * @member {google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity|null|undefined} channelPartnerGranularity + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.channelPartnerGranularity = null; + + /** + * RepricingConfig effectiveInvoiceMonth. + * @member {google.type.IDate|null|undefined} effectiveInvoiceMonth + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.effectiveInvoiceMonth = null; + + /** + * RepricingConfig adjustment. + * @member {google.cloud.channel.v1.IRepricingAdjustment|null|undefined} adjustment + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.adjustment = null; + + /** + * RepricingConfig rebillingBasis. + * @member {google.cloud.channel.v1.RebillingBasis} rebillingBasis + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.rebillingBasis = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepricingConfig granularity. + * @member {"entitlementGranularity"|"channelPartnerGranularity"|undefined} granularity + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + Object.defineProperty(RepricingConfig.prototype, "granularity", { + get: $util.oneOfGetter($oneOfFields = ["entitlementGranularity", "channelPartnerGranularity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepricingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {google.cloud.channel.v1.IRepricingConfig=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RepricingConfig} RepricingConfig instance + */ + RepricingConfig.create = function create(properties) { + return new RepricingConfig(properties); + }; + + /** + * Encodes the specified RepricingConfig message. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {google.cloud.channel.v1.IRepricingConfig} message RepricingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.effectiveInvoiceMonth != null && Object.hasOwnProperty.call(message, "effectiveInvoiceMonth")) + $root.google.type.Date.encode(message.effectiveInvoiceMonth, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.adjustment != null && Object.hasOwnProperty.call(message, "adjustment")) + $root.google.cloud.channel.v1.RepricingAdjustment.encode(message.adjustment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rebillingBasis != null && Object.hasOwnProperty.call(message, "rebillingBasis")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rebillingBasis); + if (message.entitlementGranularity != null && Object.hasOwnProperty.call(message, "entitlementGranularity")) + $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.encode(message.entitlementGranularity, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.channelPartnerGranularity != null && Object.hasOwnProperty.call(message, "channelPartnerGranularity")) + $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.encode(message.channelPartnerGranularity, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepricingConfig message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {google.cloud.channel.v1.IRepricingConfig} message RepricingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepricingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RepricingConfig} RepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RepricingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.entitlementGranularity = $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.decode(reader, reader.uint32()); + break; + } + case 5: { + message.channelPartnerGranularity = $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.decode(reader, reader.uint32()); + break; + } + case 1: { + message.effectiveInvoiceMonth = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 2: { + message.adjustment = $root.google.cloud.channel.v1.RepricingAdjustment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.rebillingBasis = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepricingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RepricingConfig} RepricingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepricingConfig message. + * @function verify + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepricingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.entitlementGranularity != null && message.hasOwnProperty("entitlementGranularity")) { + properties.granularity = 1; + { + var error = $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.verify(message.entitlementGranularity); + if (error) + return "entitlementGranularity." + error; + } + } + if (message.channelPartnerGranularity != null && message.hasOwnProperty("channelPartnerGranularity")) { + if (properties.granularity === 1) + return "granularity: multiple values"; + properties.granularity = 1; + { + var error = $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.verify(message.channelPartnerGranularity); + if (error) + return "channelPartnerGranularity." + error; + } + } + if (message.effectiveInvoiceMonth != null && message.hasOwnProperty("effectiveInvoiceMonth")) { + var error = $root.google.type.Date.verify(message.effectiveInvoiceMonth); + if (error) + return "effectiveInvoiceMonth." + error; + } + if (message.adjustment != null && message.hasOwnProperty("adjustment")) { + var error = $root.google.cloud.channel.v1.RepricingAdjustment.verify(message.adjustment); + if (error) + return "adjustment." + error; + } + if (message.rebillingBasis != null && message.hasOwnProperty("rebillingBasis")) + switch (message.rebillingBasis) { + default: + return "rebillingBasis: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a RepricingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RepricingConfig} RepricingConfig + */ + RepricingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RepricingConfig) + return object; + var message = new $root.google.cloud.channel.v1.RepricingConfig(); + if (object.entitlementGranularity != null) { + if (typeof object.entitlementGranularity !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingConfig.entitlementGranularity: object expected"); + message.entitlementGranularity = $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.fromObject(object.entitlementGranularity); + } + if (object.channelPartnerGranularity != null) { + if (typeof object.channelPartnerGranularity !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingConfig.channelPartnerGranularity: object expected"); + message.channelPartnerGranularity = $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.fromObject(object.channelPartnerGranularity); + } + if (object.effectiveInvoiceMonth != null) { + if (typeof object.effectiveInvoiceMonth !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingConfig.effectiveInvoiceMonth: object expected"); + message.effectiveInvoiceMonth = $root.google.type.Date.fromObject(object.effectiveInvoiceMonth); + } + if (object.adjustment != null) { + if (typeof object.adjustment !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingConfig.adjustment: object expected"); + message.adjustment = $root.google.cloud.channel.v1.RepricingAdjustment.fromObject(object.adjustment); + } + switch (object.rebillingBasis) { + default: + if (typeof object.rebillingBasis === "number") { + message.rebillingBasis = object.rebillingBasis; + break; + } + break; + case "REBILLING_BASIS_UNSPECIFIED": + case 0: + message.rebillingBasis = 0; + break; + case "COST_AT_LIST": + case 1: + message.rebillingBasis = 1; + break; + case "DIRECT_CUSTOMER_COST": + case 2: + message.rebillingBasis = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RepricingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {google.cloud.channel.v1.RepricingConfig} message RepricingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepricingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.effectiveInvoiceMonth = null; + object.adjustment = null; + object.rebillingBasis = options.enums === String ? "REBILLING_BASIS_UNSPECIFIED" : 0; + } + if (message.effectiveInvoiceMonth != null && message.hasOwnProperty("effectiveInvoiceMonth")) + object.effectiveInvoiceMonth = $root.google.type.Date.toObject(message.effectiveInvoiceMonth, options); + if (message.adjustment != null && message.hasOwnProperty("adjustment")) + object.adjustment = $root.google.cloud.channel.v1.RepricingAdjustment.toObject(message.adjustment, options); + if (message.rebillingBasis != null && message.hasOwnProperty("rebillingBasis")) + object.rebillingBasis = options.enums === String ? $root.google.cloud.channel.v1.RebillingBasis[message.rebillingBasis] === undefined ? message.rebillingBasis : $root.google.cloud.channel.v1.RebillingBasis[message.rebillingBasis] : message.rebillingBasis; + if (message.entitlementGranularity != null && message.hasOwnProperty("entitlementGranularity")) { + object.entitlementGranularity = $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.toObject(message.entitlementGranularity, options); + if (options.oneofs) + object.granularity = "entitlementGranularity"; + } + if (message.channelPartnerGranularity != null && message.hasOwnProperty("channelPartnerGranularity")) { + object.channelPartnerGranularity = $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.toObject(message.channelPartnerGranularity, options); + if (options.oneofs) + object.granularity = "channelPartnerGranularity"; + } + return object; + }; + + /** + * Converts this RepricingConfig to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + * @returns {Object.} JSON object + */ + RepricingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepricingConfig + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RepricingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepricingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RepricingConfig"; + }; + + RepricingConfig.EntitlementGranularity = (function() { + + /** + * Properties of an EntitlementGranularity. + * @memberof google.cloud.channel.v1.RepricingConfig + * @interface IEntitlementGranularity + * @property {string|null} [entitlement] EntitlementGranularity entitlement + */ + + /** + * Constructs a new EntitlementGranularity. + * @memberof google.cloud.channel.v1.RepricingConfig + * @classdesc Represents an EntitlementGranularity. + * @implements IEntitlementGranularity + * @constructor + * @param {google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity=} [properties] Properties to set + */ + function EntitlementGranularity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntitlementGranularity entitlement. + * @member {string} entitlement + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @instance + */ + EntitlementGranularity.prototype.entitlement = ""; + + /** + * Creates a new EntitlementGranularity instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RepricingConfig.EntitlementGranularity} EntitlementGranularity instance + */ + EntitlementGranularity.create = function create(properties) { + return new EntitlementGranularity(properties); + }; + + /** + * Encodes the specified EntitlementGranularity message. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity} message EntitlementGranularity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntitlementGranularity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlement != null && Object.hasOwnProperty.call(message, "entitlement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entitlement); + return writer; + }; + + /** + * Encodes the specified EntitlementGranularity message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.IEntitlementGranularity} message EntitlementGranularity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntitlementGranularity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntitlementGranularity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RepricingConfig.EntitlementGranularity} EntitlementGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntitlementGranularity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entitlement = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntitlementGranularity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RepricingConfig.EntitlementGranularity} EntitlementGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntitlementGranularity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntitlementGranularity message. + * @function verify + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntitlementGranularity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + if (!$util.isString(message.entitlement)) + return "entitlement: string expected"; + return null; + }; + + /** + * Creates an EntitlementGranularity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RepricingConfig.EntitlementGranularity} EntitlementGranularity + */ + EntitlementGranularity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity) + return object; + var message = new $root.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity(); + if (object.entitlement != null) + message.entitlement = String(object.entitlement); + return message; + }; + + /** + * Creates a plain object from an EntitlementGranularity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.EntitlementGranularity} message EntitlementGranularity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntitlementGranularity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entitlement = ""; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + object.entitlement = message.entitlement; + return object; + }; + + /** + * Converts this EntitlementGranularity to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @instance + * @returns {Object.} JSON object + */ + EntitlementGranularity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntitlementGranularity + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RepricingConfig.EntitlementGranularity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntitlementGranularity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RepricingConfig.EntitlementGranularity"; + }; + + return EntitlementGranularity; + })(); + + RepricingConfig.ChannelPartnerGranularity = (function() { + + /** + * Properties of a ChannelPartnerGranularity. + * @memberof google.cloud.channel.v1.RepricingConfig + * @interface IChannelPartnerGranularity + */ + + /** + * Constructs a new ChannelPartnerGranularity. + * @memberof google.cloud.channel.v1.RepricingConfig + * @classdesc Represents a ChannelPartnerGranularity. + * @implements IChannelPartnerGranularity + * @constructor + * @param {google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity=} [properties] Properties to set + */ + function ChannelPartnerGranularity(properties) { + if (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 ChannelPartnerGranularity instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity} ChannelPartnerGranularity instance + */ + ChannelPartnerGranularity.create = function create(properties) { + return new ChannelPartnerGranularity(properties); + }; + + /** + * Encodes the specified ChannelPartnerGranularity message. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity} message ChannelPartnerGranularity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelPartnerGranularity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ChannelPartnerGranularity message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.IChannelPartnerGranularity} message ChannelPartnerGranularity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelPartnerGranularity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelPartnerGranularity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity} ChannelPartnerGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelPartnerGranularity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelPartnerGranularity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity} ChannelPartnerGranularity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelPartnerGranularity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelPartnerGranularity message. + * @function verify + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelPartnerGranularity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ChannelPartnerGranularity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity} ChannelPartnerGranularity + */ + ChannelPartnerGranularity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity) + return object; + return new $root.google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity(); + }; + + /** + * Creates a plain object from a ChannelPartnerGranularity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity} message ChannelPartnerGranularity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelPartnerGranularity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ChannelPartnerGranularity to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @instance + * @returns {Object.} JSON object + */ + ChannelPartnerGranularity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelPartnerGranularity + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelPartnerGranularity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity"; + }; + + return ChannelPartnerGranularity; + })(); + + return RepricingConfig; + })(); + + v1.RepricingAdjustment = (function() { + + /** + * Properties of a RepricingAdjustment. + * @memberof google.cloud.channel.v1 + * @interface IRepricingAdjustment + * @property {google.cloud.channel.v1.IPercentageAdjustment|null} [percentageAdjustment] RepricingAdjustment percentageAdjustment + */ + + /** + * Constructs a new RepricingAdjustment. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RepricingAdjustment. + * @implements IRepricingAdjustment + * @constructor + * @param {google.cloud.channel.v1.IRepricingAdjustment=} [properties] Properties to set + */ + function RepricingAdjustment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepricingAdjustment percentageAdjustment. + * @member {google.cloud.channel.v1.IPercentageAdjustment|null|undefined} percentageAdjustment + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @instance + */ + RepricingAdjustment.prototype.percentageAdjustment = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepricingAdjustment adjustment. + * @member {"percentageAdjustment"|undefined} adjustment + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @instance + */ + Object.defineProperty(RepricingAdjustment.prototype, "adjustment", { + get: $util.oneOfGetter($oneOfFields = ["percentageAdjustment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepricingAdjustment instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {google.cloud.channel.v1.IRepricingAdjustment=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RepricingAdjustment} RepricingAdjustment instance + */ + RepricingAdjustment.create = function create(properties) { + return new RepricingAdjustment(properties); + }; + + /** + * Encodes the specified RepricingAdjustment message. Does not implicitly {@link google.cloud.channel.v1.RepricingAdjustment.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {google.cloud.channel.v1.IRepricingAdjustment} message RepricingAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingAdjustment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.percentageAdjustment != null && Object.hasOwnProperty.call(message, "percentageAdjustment")) + $root.google.cloud.channel.v1.PercentageAdjustment.encode(message.percentageAdjustment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepricingAdjustment message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingAdjustment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {google.cloud.channel.v1.IRepricingAdjustment} message RepricingAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingAdjustment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepricingAdjustment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RepricingAdjustment} RepricingAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingAdjustment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RepricingAdjustment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.percentageAdjustment = $root.google.cloud.channel.v1.PercentageAdjustment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepricingAdjustment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RepricingAdjustment} RepricingAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingAdjustment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepricingAdjustment message. + * @function verify + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepricingAdjustment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.percentageAdjustment != null && message.hasOwnProperty("percentageAdjustment")) { + properties.adjustment = 1; + { + var error = $root.google.cloud.channel.v1.PercentageAdjustment.verify(message.percentageAdjustment); + if (error) + return "percentageAdjustment." + error; + } + } + return null; + }; + + /** + * Creates a RepricingAdjustment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RepricingAdjustment} RepricingAdjustment + */ + RepricingAdjustment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RepricingAdjustment) + return object; + var message = new $root.google.cloud.channel.v1.RepricingAdjustment(); + if (object.percentageAdjustment != null) { + if (typeof object.percentageAdjustment !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingAdjustment.percentageAdjustment: object expected"); + message.percentageAdjustment = $root.google.cloud.channel.v1.PercentageAdjustment.fromObject(object.percentageAdjustment); + } + return message; + }; + + /** + * Creates a plain object from a RepricingAdjustment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {google.cloud.channel.v1.RepricingAdjustment} message RepricingAdjustment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepricingAdjustment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.percentageAdjustment != null && message.hasOwnProperty("percentageAdjustment")) { + object.percentageAdjustment = $root.google.cloud.channel.v1.PercentageAdjustment.toObject(message.percentageAdjustment, options); + if (options.oneofs) + object.adjustment = "percentageAdjustment"; + } + return object; + }; + + /** + * Converts this RepricingAdjustment to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @instance + * @returns {Object.} JSON object + */ + RepricingAdjustment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepricingAdjustment + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RepricingAdjustment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepricingAdjustment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RepricingAdjustment"; + }; + + return RepricingAdjustment; + })(); + + v1.PercentageAdjustment = (function() { + + /** + * Properties of a PercentageAdjustment. + * @memberof google.cloud.channel.v1 + * @interface IPercentageAdjustment + * @property {google.type.IDecimal|null} [percentage] PercentageAdjustment percentage + */ + + /** + * Constructs a new PercentageAdjustment. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a PercentageAdjustment. + * @implements IPercentageAdjustment + * @constructor + * @param {google.cloud.channel.v1.IPercentageAdjustment=} [properties] Properties to set + */ + function PercentageAdjustment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PercentageAdjustment percentage. + * @member {google.type.IDecimal|null|undefined} percentage + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @instance + */ + PercentageAdjustment.prototype.percentage = null; + + /** + * Creates a new PercentageAdjustment instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {google.cloud.channel.v1.IPercentageAdjustment=} [properties] Properties to set + * @returns {google.cloud.channel.v1.PercentageAdjustment} PercentageAdjustment instance + */ + PercentageAdjustment.create = function create(properties) { + return new PercentageAdjustment(properties); + }; + + /** + * Encodes the specified PercentageAdjustment message. Does not implicitly {@link google.cloud.channel.v1.PercentageAdjustment.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {google.cloud.channel.v1.IPercentageAdjustment} message PercentageAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PercentageAdjustment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + $root.google.type.Decimal.encode(message.percentage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PercentageAdjustment message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PercentageAdjustment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {google.cloud.channel.v1.IPercentageAdjustment} message PercentageAdjustment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PercentageAdjustment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PercentageAdjustment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.PercentageAdjustment} PercentageAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PercentageAdjustment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.PercentageAdjustment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.percentage = $root.google.type.Decimal.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PercentageAdjustment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.PercentageAdjustment} PercentageAdjustment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PercentageAdjustment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PercentageAdjustment message. + * @function verify + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PercentageAdjustment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.percentage != null && message.hasOwnProperty("percentage")) { + var error = $root.google.type.Decimal.verify(message.percentage); + if (error) + return "percentage." + error; + } + return null; + }; + + /** + * Creates a PercentageAdjustment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.PercentageAdjustment} PercentageAdjustment + */ + PercentageAdjustment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.PercentageAdjustment) + return object; + var message = new $root.google.cloud.channel.v1.PercentageAdjustment(); + if (object.percentage != null) { + if (typeof object.percentage !== "object") + throw TypeError(".google.cloud.channel.v1.PercentageAdjustment.percentage: object expected"); + message.percentage = $root.google.type.Decimal.fromObject(object.percentage); + } + return message; + }; + + /** + * Creates a plain object from a PercentageAdjustment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {google.cloud.channel.v1.PercentageAdjustment} message PercentageAdjustment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PercentageAdjustment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.percentage = null; + if (message.percentage != null && message.hasOwnProperty("percentage")) + object.percentage = $root.google.type.Decimal.toObject(message.percentage, options); + return object; + }; + + /** + * Converts this PercentageAdjustment to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @instance + * @returns {Object.} JSON object + */ + PercentageAdjustment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PercentageAdjustment + * @function getTypeUrl + * @memberof google.cloud.channel.v1.PercentageAdjustment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PercentageAdjustment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.PercentageAdjustment"; + }; + + return PercentageAdjustment; + })(); + + v1.CloudChannelService = (function() { + + /** + * Constructs a new CloudChannelService service. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CloudChannelService + * @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 CloudChannelService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudChannelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudChannelService; + + /** + * Creates new CloudChannelService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.channel.v1.CloudChannelService + * @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 {CloudChannelService} RPC service. Useful where requests and/or responses are streamed. + */ + CloudChannelService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listCustomers}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListCustomersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListCustomersResponse} [response] ListCustomersResponse + */ + + /** + * Calls ListCustomers. + * @function listCustomers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListCustomersRequest} request ListCustomersRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListCustomersCallback} callback Node-style callback called with the error, if any, and ListCustomersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listCustomers = function listCustomers(request, callback) { + return this.rpcCall(listCustomers, $root.google.cloud.channel.v1.ListCustomersRequest, $root.google.cloud.channel.v1.ListCustomersResponse, request, callback); + }, "name", { value: "ListCustomers" }); + + /** + * Calls ListCustomers. + * @function listCustomers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListCustomersRequest} request ListCustomersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getCustomer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef GetCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.Customer} [response] Customer + */ + + /** + * Calls GetCustomer. + * @function getCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetCustomerRequest} request GetCustomerRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.GetCustomerCallback} callback Node-style callback called with the error, if any, and Customer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.getCustomer = function getCustomer(request, callback) { + return this.rpcCall(getCustomer, $root.google.cloud.channel.v1.GetCustomerRequest, $root.google.cloud.channel.v1.Customer, request, callback); + }, "name", { value: "GetCustomer" }); + + /** + * Calls GetCustomer. + * @function getCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetCustomerRequest} request GetCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|checkCloudIdentityAccountsExist}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CheckCloudIdentityAccountsExistCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse} [response] CheckCloudIdentityAccountsExistResponse + */ + + /** + * Calls CheckCloudIdentityAccountsExist. + * @function checkCloudIdentityAccountsExist + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest} request CheckCloudIdentityAccountsExistRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExistCallback} callback Node-style callback called with the error, if any, and CheckCloudIdentityAccountsExistResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.checkCloudIdentityAccountsExist = function checkCloudIdentityAccountsExist(request, callback) { + return this.rpcCall(checkCloudIdentityAccountsExist, $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest, $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse, request, callback); + }, "name", { value: "CheckCloudIdentityAccountsExist" }); + + /** + * Calls CheckCloudIdentityAccountsExist. + * @function checkCloudIdentityAccountsExist + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest} request CheckCloudIdentityAccountsExistRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createCustomer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CreateCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.Customer} [response] Customer + */ + + /** + * Calls CreateCustomer. + * @function createCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateCustomerRequest} request CreateCustomerRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CreateCustomerCallback} callback Node-style callback called with the error, if any, and Customer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.createCustomer = function createCustomer(request, callback) { + return this.rpcCall(createCustomer, $root.google.cloud.channel.v1.CreateCustomerRequest, $root.google.cloud.channel.v1.Customer, request, callback); + }, "name", { value: "CreateCustomer" }); + + /** + * Calls CreateCustomer. + * @function createCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateCustomerRequest} request CreateCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateCustomer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef UpdateCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.Customer} [response] Customer + */ + + /** + * Calls UpdateCustomer. + * @function updateCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateCustomerRequest} request UpdateCustomerRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.UpdateCustomerCallback} callback Node-style callback called with the error, if any, and Customer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.updateCustomer = function updateCustomer(request, callback) { + return this.rpcCall(updateCustomer, $root.google.cloud.channel.v1.UpdateCustomerRequest, $root.google.cloud.channel.v1.Customer, request, callback); + }, "name", { value: "UpdateCustomer" }); + + /** + * Calls UpdateCustomer. + * @function updateCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateCustomerRequest} request UpdateCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|deleteCustomer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef DeleteCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCustomer. + * @function deleteCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IDeleteCustomerRequest} request DeleteCustomerRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.DeleteCustomerCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.deleteCustomer = function deleteCustomer(request, callback) { + return this.rpcCall(deleteCustomer, $root.google.cloud.channel.v1.DeleteCustomerRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCustomer" }); + + /** + * Calls DeleteCustomer. + * @function deleteCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IDeleteCustomerRequest} request DeleteCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|importCustomer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ImportCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.Customer} [response] Customer + */ + + /** + * Calls ImportCustomer. + * @function importCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IImportCustomerRequest} request ImportCustomerRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ImportCustomerCallback} callback Node-style callback called with the error, if any, and Customer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.importCustomer = function importCustomer(request, callback) { + return this.rpcCall(importCustomer, $root.google.cloud.channel.v1.ImportCustomerRequest, $root.google.cloud.channel.v1.Customer, request, callback); + }, "name", { value: "ImportCustomer" }); + + /** + * Calls ImportCustomer. + * @function importCustomer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IImportCustomerRequest} request ImportCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|provisionCloudIdentity}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ProvisionCloudIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ProvisionCloudIdentity. + * @function provisionCloudIdentity + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IProvisionCloudIdentityRequest} request ProvisionCloudIdentityRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentityCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.provisionCloudIdentity = function provisionCloudIdentity(request, callback) { + return this.rpcCall(provisionCloudIdentity, $root.google.cloud.channel.v1.ProvisionCloudIdentityRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ProvisionCloudIdentity" }); + + /** + * Calls ProvisionCloudIdentity. + * @function provisionCloudIdentity + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IProvisionCloudIdentityRequest} request ProvisionCloudIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listEntitlements}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListEntitlementsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListEntitlementsResponse} [response] ListEntitlementsResponse + */ + + /** + * Calls ListEntitlements. + * @function listEntitlements + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListEntitlementsRequest} request ListEntitlementsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListEntitlementsCallback} callback Node-style callback called with the error, if any, and ListEntitlementsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listEntitlements = function listEntitlements(request, callback) { + return this.rpcCall(listEntitlements, $root.google.cloud.channel.v1.ListEntitlementsRequest, $root.google.cloud.channel.v1.ListEntitlementsResponse, request, callback); + }, "name", { value: "ListEntitlements" }); + + /** + * Calls ListEntitlements. + * @function listEntitlements + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListEntitlementsRequest} request ListEntitlementsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listTransferableSkus}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListTransferableSkusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListTransferableSkusResponse} [response] ListTransferableSkusResponse + */ + + /** + * Calls ListTransferableSkus. + * @function listTransferableSkus + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListTransferableSkusRequest} request ListTransferableSkusRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListTransferableSkusCallback} callback Node-style callback called with the error, if any, and ListTransferableSkusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listTransferableSkus = function listTransferableSkus(request, callback) { + return this.rpcCall(listTransferableSkus, $root.google.cloud.channel.v1.ListTransferableSkusRequest, $root.google.cloud.channel.v1.ListTransferableSkusResponse, request, callback); + }, "name", { value: "ListTransferableSkus" }); + + /** + * Calls ListTransferableSkus. + * @function listTransferableSkus + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListTransferableSkusRequest} request ListTransferableSkusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listTransferableOffers}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListTransferableOffersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListTransferableOffersResponse} [response] ListTransferableOffersResponse + */ + + /** + * Calls ListTransferableOffers. + * @function listTransferableOffers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListTransferableOffersRequest} request ListTransferableOffersRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListTransferableOffersCallback} callback Node-style callback called with the error, if any, and ListTransferableOffersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listTransferableOffers = function listTransferableOffers(request, callback) { + return this.rpcCall(listTransferableOffers, $root.google.cloud.channel.v1.ListTransferableOffersRequest, $root.google.cloud.channel.v1.ListTransferableOffersResponse, request, callback); + }, "name", { value: "ListTransferableOffers" }); + + /** + * Calls ListTransferableOffers. + * @function listTransferableOffers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListTransferableOffersRequest} request ListTransferableOffersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getEntitlement}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef GetEntitlementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.Entitlement} [response] Entitlement + */ + + /** + * Calls GetEntitlement. + * @function getEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetEntitlementRequest} request GetEntitlementRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.GetEntitlementCallback} callback Node-style callback called with the error, if any, and Entitlement + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.getEntitlement = function getEntitlement(request, callback) { + return this.rpcCall(getEntitlement, $root.google.cloud.channel.v1.GetEntitlementRequest, $root.google.cloud.channel.v1.Entitlement, request, callback); + }, "name", { value: "GetEntitlement" }); + + /** + * Calls GetEntitlement. + * @function getEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetEntitlementRequest} request GetEntitlementRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createEntitlement}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CreateEntitlementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEntitlement. + * @function createEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateEntitlementRequest} request CreateEntitlementRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CreateEntitlementCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.createEntitlement = function createEntitlement(request, callback) { + return this.rpcCall(createEntitlement, $root.google.cloud.channel.v1.CreateEntitlementRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEntitlement" }); + + /** + * Calls CreateEntitlement. + * @function createEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateEntitlementRequest} request CreateEntitlementRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|changeParameters}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ChangeParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ChangeParameters. + * @function changeParameters + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IChangeParametersRequest} request ChangeParametersRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ChangeParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.changeParameters = function changeParameters(request, callback) { + return this.rpcCall(changeParameters, $root.google.cloud.channel.v1.ChangeParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ChangeParameters" }); + + /** + * Calls ChangeParameters. + * @function changeParameters + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IChangeParametersRequest} request ChangeParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|changeRenewalSettings}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ChangeRenewalSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ChangeRenewalSettings. + * @function changeRenewalSettings + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IChangeRenewalSettingsRequest} request ChangeRenewalSettingsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettingsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.changeRenewalSettings = function changeRenewalSettings(request, callback) { + return this.rpcCall(changeRenewalSettings, $root.google.cloud.channel.v1.ChangeRenewalSettingsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ChangeRenewalSettings" }); + + /** + * Calls ChangeRenewalSettings. + * @function changeRenewalSettings + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IChangeRenewalSettingsRequest} request ChangeRenewalSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|changeOffer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ChangeOfferCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ChangeOffer. + * @function changeOffer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IChangeOfferRequest} request ChangeOfferRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ChangeOfferCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.changeOffer = function changeOffer(request, callback) { + return this.rpcCall(changeOffer, $root.google.cloud.channel.v1.ChangeOfferRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ChangeOffer" }); + + /** + * Calls ChangeOffer. + * @function changeOffer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IChangeOfferRequest} request ChangeOfferRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|startPaidService}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef StartPaidServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartPaidService. + * @function startPaidService + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IStartPaidServiceRequest} request StartPaidServiceRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.StartPaidServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.startPaidService = function startPaidService(request, callback) { + return this.rpcCall(startPaidService, $root.google.cloud.channel.v1.StartPaidServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartPaidService" }); + + /** + * Calls StartPaidService. + * @function startPaidService + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IStartPaidServiceRequest} request StartPaidServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|suspendEntitlement}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef SuspendEntitlementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SuspendEntitlement. + * @function suspendEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ISuspendEntitlementRequest} request SuspendEntitlementRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.SuspendEntitlementCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.suspendEntitlement = function suspendEntitlement(request, callback) { + return this.rpcCall(suspendEntitlement, $root.google.cloud.channel.v1.SuspendEntitlementRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SuspendEntitlement" }); + + /** + * Calls SuspendEntitlement. + * @function suspendEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ISuspendEntitlementRequest} request SuspendEntitlementRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|cancelEntitlement}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CancelEntitlementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelEntitlement. + * @function cancelEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICancelEntitlementRequest} request CancelEntitlementRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CancelEntitlementCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.cancelEntitlement = function cancelEntitlement(request, callback) { + return this.rpcCall(cancelEntitlement, $root.google.cloud.channel.v1.CancelEntitlementRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelEntitlement" }); + + /** + * Calls CancelEntitlement. + * @function cancelEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICancelEntitlementRequest} request CancelEntitlementRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|activateEntitlement}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ActivateEntitlementCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ActivateEntitlement. + * @function activateEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IActivateEntitlementRequest} request ActivateEntitlementRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ActivateEntitlementCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.activateEntitlement = function activateEntitlement(request, callback) { + return this.rpcCall(activateEntitlement, $root.google.cloud.channel.v1.ActivateEntitlementRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ActivateEntitlement" }); + + /** + * Calls ActivateEntitlement. + * @function activateEntitlement + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IActivateEntitlementRequest} request ActivateEntitlementRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|transferEntitlements}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef TransferEntitlementsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TransferEntitlements. + * @function transferEntitlements + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ITransferEntitlementsRequest} request TransferEntitlementsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.TransferEntitlementsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.transferEntitlements = function transferEntitlements(request, callback) { + return this.rpcCall(transferEntitlements, $root.google.cloud.channel.v1.TransferEntitlementsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TransferEntitlements" }); + + /** + * Calls TransferEntitlements. + * @function transferEntitlements + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ITransferEntitlementsRequest} request TransferEntitlementsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|transferEntitlementsToGoogle}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef TransferEntitlementsToGoogleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TransferEntitlementsToGoogle. + * @function transferEntitlementsToGoogle + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest} request TransferEntitlementsToGoogleRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.transferEntitlementsToGoogle = function transferEntitlementsToGoogle(request, callback) { + return this.rpcCall(transferEntitlementsToGoogle, $root.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TransferEntitlementsToGoogle" }); + + /** + * Calls TransferEntitlementsToGoogle. + * @function transferEntitlementsToGoogle + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest} request TransferEntitlementsToGoogleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listChannelPartnerLinks}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListChannelPartnerLinksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListChannelPartnerLinksResponse} [response] ListChannelPartnerLinksResponse + */ + + /** + * Calls ListChannelPartnerLinks. + * @function listChannelPartnerLinks + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListChannelPartnerLinksRequest} request ListChannelPartnerLinksRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinksCallback} callback Node-style callback called with the error, if any, and ListChannelPartnerLinksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listChannelPartnerLinks = function listChannelPartnerLinks(request, callback) { + return this.rpcCall(listChannelPartnerLinks, $root.google.cloud.channel.v1.ListChannelPartnerLinksRequest, $root.google.cloud.channel.v1.ListChannelPartnerLinksResponse, request, callback); + }, "name", { value: "ListChannelPartnerLinks" }); + + /** + * Calls ListChannelPartnerLinks. + * @function listChannelPartnerLinks + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListChannelPartnerLinksRequest} request ListChannelPartnerLinksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getChannelPartnerLink}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef GetChannelPartnerLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ChannelPartnerLink} [response] ChannelPartnerLink + */ + + /** + * Calls GetChannelPartnerLink. + * @function getChannelPartnerLink + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetChannelPartnerLinkRequest} request GetChannelPartnerLinkRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLinkCallback} callback Node-style callback called with the error, if any, and ChannelPartnerLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.getChannelPartnerLink = function getChannelPartnerLink(request, callback) { + return this.rpcCall(getChannelPartnerLink, $root.google.cloud.channel.v1.GetChannelPartnerLinkRequest, $root.google.cloud.channel.v1.ChannelPartnerLink, request, callback); + }, "name", { value: "GetChannelPartnerLink" }); + + /** + * Calls GetChannelPartnerLink. + * @function getChannelPartnerLink + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetChannelPartnerLinkRequest} request GetChannelPartnerLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createChannelPartnerLink}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CreateChannelPartnerLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ChannelPartnerLink} [response] ChannelPartnerLink + */ + + /** + * Calls CreateChannelPartnerLink. + * @function createChannelPartnerLink + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateChannelPartnerLinkRequest} request CreateChannelPartnerLinkRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLinkCallback} callback Node-style callback called with the error, if any, and ChannelPartnerLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.createChannelPartnerLink = function createChannelPartnerLink(request, callback) { + return this.rpcCall(createChannelPartnerLink, $root.google.cloud.channel.v1.CreateChannelPartnerLinkRequest, $root.google.cloud.channel.v1.ChannelPartnerLink, request, callback); + }, "name", { value: "CreateChannelPartnerLink" }); + + /** + * Calls CreateChannelPartnerLink. + * @function createChannelPartnerLink + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateChannelPartnerLinkRequest} request CreateChannelPartnerLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateChannelPartnerLink}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef UpdateChannelPartnerLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ChannelPartnerLink} [response] ChannelPartnerLink + */ + + /** + * Calls UpdateChannelPartnerLink. + * @function updateChannelPartnerLink + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest} request UpdateChannelPartnerLinkRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLinkCallback} callback Node-style callback called with the error, if any, and ChannelPartnerLink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.updateChannelPartnerLink = function updateChannelPartnerLink(request, callback) { + return this.rpcCall(updateChannelPartnerLink, $root.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest, $root.google.cloud.channel.v1.ChannelPartnerLink, request, callback); + }, "name", { value: "UpdateChannelPartnerLink" }); + + /** + * Calls UpdateChannelPartnerLink. + * @function updateChannelPartnerLink + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest} request UpdateChannelPartnerLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getCustomerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef GetCustomerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.CustomerRepricingConfig} [response] CustomerRepricingConfig + */ + + /** + * Calls GetCustomerRepricingConfig. + * @function getCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetCustomerRepricingConfigRequest} request GetCustomerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfigCallback} callback Node-style callback called with the error, if any, and CustomerRepricingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.getCustomerRepricingConfig = function getCustomerRepricingConfig(request, callback) { + return this.rpcCall(getCustomerRepricingConfig, $root.google.cloud.channel.v1.GetCustomerRepricingConfigRequest, $root.google.cloud.channel.v1.CustomerRepricingConfig, request, callback); + }, "name", { value: "GetCustomerRepricingConfig" }); + + /** + * Calls GetCustomerRepricingConfig. + * @function getCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetCustomerRepricingConfigRequest} request GetCustomerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listCustomerRepricingConfigs}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListCustomerRepricingConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListCustomerRepricingConfigsResponse} [response] ListCustomerRepricingConfigsResponse + */ + + /** + * Calls ListCustomerRepricingConfigs. + * @function listCustomerRepricingConfigs + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsRequest} request ListCustomerRepricingConfigsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigsCallback} callback Node-style callback called with the error, if any, and ListCustomerRepricingConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listCustomerRepricingConfigs = function listCustomerRepricingConfigs(request, callback) { + return this.rpcCall(listCustomerRepricingConfigs, $root.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest, $root.google.cloud.channel.v1.ListCustomerRepricingConfigsResponse, request, callback); + }, "name", { value: "ListCustomerRepricingConfigs" }); + + /** + * Calls ListCustomerRepricingConfigs. + * @function listCustomerRepricingConfigs + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsRequest} request ListCustomerRepricingConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createCustomerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CreateCustomerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.CustomerRepricingConfig} [response] CustomerRepricingConfig + */ + + /** + * Calls CreateCustomerRepricingConfig. + * @function createCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest} request CreateCustomerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfigCallback} callback Node-style callback called with the error, if any, and CustomerRepricingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.createCustomerRepricingConfig = function createCustomerRepricingConfig(request, callback) { + return this.rpcCall(createCustomerRepricingConfig, $root.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest, $root.google.cloud.channel.v1.CustomerRepricingConfig, request, callback); + }, "name", { value: "CreateCustomerRepricingConfig" }); + + /** + * Calls CreateCustomerRepricingConfig. + * @function createCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest} request CreateCustomerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateCustomerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef UpdateCustomerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.CustomerRepricingConfig} [response] CustomerRepricingConfig + */ + + /** + * Calls UpdateCustomerRepricingConfig. + * @function updateCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest} request UpdateCustomerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfigCallback} callback Node-style callback called with the error, if any, and CustomerRepricingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.updateCustomerRepricingConfig = function updateCustomerRepricingConfig(request, callback) { + return this.rpcCall(updateCustomerRepricingConfig, $root.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest, $root.google.cloud.channel.v1.CustomerRepricingConfig, request, callback); + }, "name", { value: "UpdateCustomerRepricingConfig" }); + + /** + * Calls UpdateCustomerRepricingConfig. + * @function updateCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest} request UpdateCustomerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|deleteCustomerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef DeleteCustomerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCustomerRepricingConfig. + * @function deleteCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest} request DeleteCustomerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.deleteCustomerRepricingConfig = function deleteCustomerRepricingConfig(request, callback) { + return this.rpcCall(deleteCustomerRepricingConfig, $root.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCustomerRepricingConfig" }); + + /** + * Calls DeleteCustomerRepricingConfig. + * @function deleteCustomerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest} request DeleteCustomerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|getChannelPartnerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef GetChannelPartnerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ChannelPartnerRepricingConfig} [response] ChannelPartnerRepricingConfig + */ + + /** + * Calls GetChannelPartnerRepricingConfig. + * @function getChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest} request GetChannelPartnerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfigCallback} callback Node-style callback called with the error, if any, and ChannelPartnerRepricingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.getChannelPartnerRepricingConfig = function getChannelPartnerRepricingConfig(request, callback) { + return this.rpcCall(getChannelPartnerRepricingConfig, $root.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest, $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig, request, callback); + }, "name", { value: "GetChannelPartnerRepricingConfig" }); + + /** + * Calls GetChannelPartnerRepricingConfig. + * @function getChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest} request GetChannelPartnerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listChannelPartnerRepricingConfigs}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListChannelPartnerRepricingConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse} [response] ListChannelPartnerRepricingConfigsResponse + */ + + /** + * Calls ListChannelPartnerRepricingConfigs. + * @function listChannelPartnerRepricingConfigs + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest} request ListChannelPartnerRepricingConfigsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigsCallback} callback Node-style callback called with the error, if any, and ListChannelPartnerRepricingConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listChannelPartnerRepricingConfigs = function listChannelPartnerRepricingConfigs(request, callback) { + return this.rpcCall(listChannelPartnerRepricingConfigs, $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest, $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse, request, callback); + }, "name", { value: "ListChannelPartnerRepricingConfigs" }); + + /** + * Calls ListChannelPartnerRepricingConfigs. + * @function listChannelPartnerRepricingConfigs + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest} request ListChannelPartnerRepricingConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|createChannelPartnerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef CreateChannelPartnerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ChannelPartnerRepricingConfig} [response] ChannelPartnerRepricingConfig + */ + + /** + * Calls CreateChannelPartnerRepricingConfig. + * @function createChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest} request CreateChannelPartnerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfigCallback} callback Node-style callback called with the error, if any, and ChannelPartnerRepricingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.createChannelPartnerRepricingConfig = function createChannelPartnerRepricingConfig(request, callback) { + return this.rpcCall(createChannelPartnerRepricingConfig, $root.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest, $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig, request, callback); + }, "name", { value: "CreateChannelPartnerRepricingConfig" }); + + /** + * Calls CreateChannelPartnerRepricingConfig. + * @function createChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest} request CreateChannelPartnerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|updateChannelPartnerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef UpdateChannelPartnerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ChannelPartnerRepricingConfig} [response] ChannelPartnerRepricingConfig + */ + + /** + * Calls UpdateChannelPartnerRepricingConfig. + * @function updateChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest} request UpdateChannelPartnerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerRepricingConfigCallback} callback Node-style callback called with the error, if any, and ChannelPartnerRepricingConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.updateChannelPartnerRepricingConfig = function updateChannelPartnerRepricingConfig(request, callback) { + return this.rpcCall(updateChannelPartnerRepricingConfig, $root.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest, $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig, request, callback); + }, "name", { value: "UpdateChannelPartnerRepricingConfig" }); + + /** + * Calls UpdateChannelPartnerRepricingConfig. + * @function updateChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest} request UpdateChannelPartnerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|deleteChannelPartnerRepricingConfig}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef DeleteChannelPartnerRepricingConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteChannelPartnerRepricingConfig. + * @function deleteChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest} request DeleteChannelPartnerRepricingConfigRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.DeleteChannelPartnerRepricingConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.deleteChannelPartnerRepricingConfig = function deleteChannelPartnerRepricingConfig(request, callback) { + return this.rpcCall(deleteChannelPartnerRepricingConfig, $root.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteChannelPartnerRepricingConfig" }); + + /** + * Calls DeleteChannelPartnerRepricingConfig. + * @function deleteChannelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest} request DeleteChannelPartnerRepricingConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|lookupOffer}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef LookupOfferCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.Offer} [response] Offer + */ + + /** + * Calls LookupOffer. + * @function lookupOffer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ILookupOfferRequest} request LookupOfferRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.LookupOfferCallback} callback Node-style callback called with the error, if any, and Offer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.lookupOffer = function lookupOffer(request, callback) { + return this.rpcCall(lookupOffer, $root.google.cloud.channel.v1.LookupOfferRequest, $root.google.cloud.channel.v1.Offer, request, callback); + }, "name", { value: "LookupOffer" }); + + /** + * Calls LookupOffer. + * @function lookupOffer + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.ILookupOfferRequest} request LookupOfferRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listProducts}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListProductsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListProductsResponse} [response] ListProductsResponse + */ + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListProductsRequest} request ListProductsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListProductsCallback} callback Node-style callback called with the error, if any, and ListProductsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listProducts = function listProducts(request, callback) { + return this.rpcCall(listProducts, $root.google.cloud.channel.v1.ListProductsRequest, $root.google.cloud.channel.v1.ListProductsResponse, request, callback); + }, "name", { value: "ListProducts" }); + + /** + * Calls ListProducts. + * @function listProducts + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListProductsRequest} request ListProductsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listSkus}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListSkusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListSkusResponse} [response] ListSkusResponse + */ + + /** + * Calls ListSkus. + * @function listSkus + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListSkusRequest} request ListSkusRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListSkusCallback} callback Node-style callback called with the error, if any, and ListSkusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listSkus = function listSkus(request, callback) { + return this.rpcCall(listSkus, $root.google.cloud.channel.v1.ListSkusRequest, $root.google.cloud.channel.v1.ListSkusResponse, request, callback); + }, "name", { value: "ListSkus" }); + + /** + * Calls ListSkus. + * @function listSkus + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListSkusRequest} request ListSkusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listOffers}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListOffersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListOffersResponse} [response] ListOffersResponse + */ + + /** + * Calls ListOffers. + * @function listOffers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListOffersRequest} request ListOffersRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListOffersCallback} callback Node-style callback called with the error, if any, and ListOffersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listOffers = function listOffers(request, callback) { + return this.rpcCall(listOffers, $root.google.cloud.channel.v1.ListOffersRequest, $root.google.cloud.channel.v1.ListOffersResponse, request, callback); + }, "name", { value: "ListOffers" }); + + /** + * Calls ListOffers. + * @function listOffers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListOffersRequest} request ListOffersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listPurchasableSkus}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListPurchasableSkusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListPurchasableSkusResponse} [response] ListPurchasableSkusResponse + */ + + /** + * Calls ListPurchasableSkus. + * @function listPurchasableSkus + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListPurchasableSkusRequest} request ListPurchasableSkusRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListPurchasableSkusCallback} callback Node-style callback called with the error, if any, and ListPurchasableSkusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listPurchasableSkus = function listPurchasableSkus(request, callback) { + return this.rpcCall(listPurchasableSkus, $root.google.cloud.channel.v1.ListPurchasableSkusRequest, $root.google.cloud.channel.v1.ListPurchasableSkusResponse, request, callback); + }, "name", { value: "ListPurchasableSkus" }); + + /** + * Calls ListPurchasableSkus. + * @function listPurchasableSkus + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListPurchasableSkusRequest} request ListPurchasableSkusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listPurchasableOffers}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListPurchasableOffersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListPurchasableOffersResponse} [response] ListPurchasableOffersResponse + */ + + /** + * Calls ListPurchasableOffers. + * @function listPurchasableOffers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListPurchasableOffersRequest} request ListPurchasableOffersRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListPurchasableOffersCallback} callback Node-style callback called with the error, if any, and ListPurchasableOffersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listPurchasableOffers = function listPurchasableOffers(request, callback) { + return this.rpcCall(listPurchasableOffers, $root.google.cloud.channel.v1.ListPurchasableOffersRequest, $root.google.cloud.channel.v1.ListPurchasableOffersResponse, request, callback); + }, "name", { value: "ListPurchasableOffers" }); + + /** + * Calls ListPurchasableOffers. + * @function listPurchasableOffers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListPurchasableOffersRequest} request ListPurchasableOffersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|registerSubscriber}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef RegisterSubscriberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.RegisterSubscriberResponse} [response] RegisterSubscriberResponse + */ + + /** + * Calls RegisterSubscriber. + * @function registerSubscriber + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IRegisterSubscriberRequest} request RegisterSubscriberRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.RegisterSubscriberCallback} callback Node-style callback called with the error, if any, and RegisterSubscriberResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.registerSubscriber = function registerSubscriber(request, callback) { + return this.rpcCall(registerSubscriber, $root.google.cloud.channel.v1.RegisterSubscriberRequest, $root.google.cloud.channel.v1.RegisterSubscriberResponse, request, callback); + }, "name", { value: "RegisterSubscriber" }); + + /** + * Calls RegisterSubscriber. + * @function registerSubscriber + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IRegisterSubscriberRequest} request RegisterSubscriberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|unregisterSubscriber}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef UnregisterSubscriberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.UnregisterSubscriberResponse} [response] UnregisterSubscriberResponse + */ + + /** + * Calls UnregisterSubscriber. + * @function unregisterSubscriber + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUnregisterSubscriberRequest} request UnregisterSubscriberRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.UnregisterSubscriberCallback} callback Node-style callback called with the error, if any, and UnregisterSubscriberResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.unregisterSubscriber = function unregisterSubscriber(request, callback) { + return this.rpcCall(unregisterSubscriber, $root.google.cloud.channel.v1.UnregisterSubscriberRequest, $root.google.cloud.channel.v1.UnregisterSubscriberResponse, request, callback); + }, "name", { value: "UnregisterSubscriber" }); + + /** + * Calls UnregisterSubscriber. + * @function unregisterSubscriber + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IUnregisterSubscriberRequest} request UnregisterSubscriberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|listSubscribers}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef ListSubscribersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.ListSubscribersResponse} [response] ListSubscribersResponse + */ + + /** + * Calls ListSubscribers. + * @function listSubscribers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListSubscribersRequest} request ListSubscribersRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.ListSubscribersCallback} callback Node-style callback called with the error, if any, and ListSubscribersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.listSubscribers = function listSubscribers(request, callback) { + return this.rpcCall(listSubscribers, $root.google.cloud.channel.v1.ListSubscribersRequest, $root.google.cloud.channel.v1.ListSubscribersResponse, request, callback); + }, "name", { value: "ListSubscribers" }); + + /** + * Calls ListSubscribers. + * @function listSubscribers + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IListSubscribersRequest} request ListSubscribersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudChannelService; + })(); + + v1.CheckCloudIdentityAccountsExistRequest = (function() { + + /** + * Properties of a CheckCloudIdentityAccountsExistRequest. + * @memberof google.cloud.channel.v1 + * @interface ICheckCloudIdentityAccountsExistRequest + * @property {string|null} [parent] CheckCloudIdentityAccountsExistRequest parent + * @property {string|null} [domain] CheckCloudIdentityAccountsExistRequest domain + */ + + /** + * Constructs a new CheckCloudIdentityAccountsExistRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CheckCloudIdentityAccountsExistRequest. + * @implements ICheckCloudIdentityAccountsExistRequest + * @constructor + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest=} [properties] Properties to set + */ + function CheckCloudIdentityAccountsExistRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckCloudIdentityAccountsExistRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @instance + */ + CheckCloudIdentityAccountsExistRequest.prototype.parent = ""; + + /** + * CheckCloudIdentityAccountsExistRequest domain. + * @member {string} domain + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @instance + */ + CheckCloudIdentityAccountsExistRequest.prototype.domain = ""; + + /** + * Creates a new CheckCloudIdentityAccountsExistRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest} CheckCloudIdentityAccountsExistRequest instance + */ + CheckCloudIdentityAccountsExistRequest.create = function create(properties) { + return new CheckCloudIdentityAccountsExistRequest(properties); + }; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistRequest message. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest} message CheckCloudIdentityAccountsExistRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCloudIdentityAccountsExistRequest.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.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain); + return writer; + }; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest} message CheckCloudIdentityAccountsExistRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCloudIdentityAccountsExistRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckCloudIdentityAccountsExistRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest} CheckCloudIdentityAccountsExistRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCloudIdentityAccountsExistRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.domain = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckCloudIdentityAccountsExistRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest} CheckCloudIdentityAccountsExistRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCloudIdentityAccountsExistRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckCloudIdentityAccountsExistRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckCloudIdentityAccountsExistRequest.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.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + return null; + }; + + /** + * Creates a CheckCloudIdentityAccountsExistRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest} CheckCloudIdentityAccountsExistRequest + */ + CheckCloudIdentityAccountsExistRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest) + return object; + var message = new $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.domain != null) + message.domain = String(object.domain); + return message; + }; + + /** + * Creates a plain object from a CheckCloudIdentityAccountsExistRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest} message CheckCloudIdentityAccountsExistRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckCloudIdentityAccountsExistRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.domain = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + return object; + }; + + /** + * Converts this CheckCloudIdentityAccountsExistRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @instance + * @returns {Object.} JSON object + */ + CheckCloudIdentityAccountsExistRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckCloudIdentityAccountsExistRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckCloudIdentityAccountsExistRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest"; + }; + + return CheckCloudIdentityAccountsExistRequest; + })(); + + v1.CloudIdentityCustomerAccount = (function() { + + /** + * Properties of a CloudIdentityCustomerAccount. + * @memberof google.cloud.channel.v1 + * @interface ICloudIdentityCustomerAccount + * @property {boolean|null} [existing] CloudIdentityCustomerAccount existing + * @property {boolean|null} [owned] CloudIdentityCustomerAccount owned + * @property {string|null} [customerName] CloudIdentityCustomerAccount customerName + * @property {string|null} [customerCloudIdentityId] CloudIdentityCustomerAccount customerCloudIdentityId + */ + + /** + * Constructs a new CloudIdentityCustomerAccount. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CloudIdentityCustomerAccount. + * @implements ICloudIdentityCustomerAccount + * @constructor + * @param {google.cloud.channel.v1.ICloudIdentityCustomerAccount=} [properties] Properties to set + */ + function CloudIdentityCustomerAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudIdentityCustomerAccount existing. + * @member {boolean} existing + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @instance + */ + CloudIdentityCustomerAccount.prototype.existing = false; + + /** + * CloudIdentityCustomerAccount owned. + * @member {boolean} owned + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @instance + */ + CloudIdentityCustomerAccount.prototype.owned = false; + + /** + * CloudIdentityCustomerAccount customerName. + * @member {string} customerName + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @instance + */ + CloudIdentityCustomerAccount.prototype.customerName = ""; + + /** + * CloudIdentityCustomerAccount customerCloudIdentityId. + * @member {string} customerCloudIdentityId + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @instance + */ + CloudIdentityCustomerAccount.prototype.customerCloudIdentityId = ""; + + /** + * Creates a new CloudIdentityCustomerAccount instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {google.cloud.channel.v1.ICloudIdentityCustomerAccount=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CloudIdentityCustomerAccount} CloudIdentityCustomerAccount instance + */ + CloudIdentityCustomerAccount.create = function create(properties) { + return new CloudIdentityCustomerAccount(properties); + }; + + /** + * Encodes the specified CloudIdentityCustomerAccount message. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityCustomerAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {google.cloud.channel.v1.ICloudIdentityCustomerAccount} message CloudIdentityCustomerAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudIdentityCustomerAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.existing != null && Object.hasOwnProperty.call(message, "existing")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.existing); + if (message.owned != null && Object.hasOwnProperty.call(message, "owned")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.owned); + if (message.customerName != null && Object.hasOwnProperty.call(message, "customerName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customerName); + if (message.customerCloudIdentityId != null && Object.hasOwnProperty.call(message, "customerCloudIdentityId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.customerCloudIdentityId); + return writer; + }; + + /** + * Encodes the specified CloudIdentityCustomerAccount message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CloudIdentityCustomerAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {google.cloud.channel.v1.ICloudIdentityCustomerAccount} message CloudIdentityCustomerAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudIdentityCustomerAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudIdentityCustomerAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CloudIdentityCustomerAccount} CloudIdentityCustomerAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudIdentityCustomerAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CloudIdentityCustomerAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.existing = reader.bool(); + break; + } + case 2: { + message.owned = reader.bool(); + break; + } + case 3: { + message.customerName = reader.string(); + break; + } + case 4: { + message.customerCloudIdentityId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudIdentityCustomerAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CloudIdentityCustomerAccount} CloudIdentityCustomerAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudIdentityCustomerAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudIdentityCustomerAccount message. + * @function verify + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudIdentityCustomerAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.existing != null && message.hasOwnProperty("existing")) + if (typeof message.existing !== "boolean") + return "existing: boolean expected"; + if (message.owned != null && message.hasOwnProperty("owned")) + if (typeof message.owned !== "boolean") + return "owned: boolean expected"; + if (message.customerName != null && message.hasOwnProperty("customerName")) + if (!$util.isString(message.customerName)) + return "customerName: string expected"; + if (message.customerCloudIdentityId != null && message.hasOwnProperty("customerCloudIdentityId")) + if (!$util.isString(message.customerCloudIdentityId)) + return "customerCloudIdentityId: string expected"; + return null; + }; + + /** + * Creates a CloudIdentityCustomerAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CloudIdentityCustomerAccount} CloudIdentityCustomerAccount + */ + CloudIdentityCustomerAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CloudIdentityCustomerAccount) + return object; + var message = new $root.google.cloud.channel.v1.CloudIdentityCustomerAccount(); + if (object.existing != null) + message.existing = Boolean(object.existing); + if (object.owned != null) + message.owned = Boolean(object.owned); + if (object.customerName != null) + message.customerName = String(object.customerName); + if (object.customerCloudIdentityId != null) + message.customerCloudIdentityId = String(object.customerCloudIdentityId); + return message; + }; + + /** + * Creates a plain object from a CloudIdentityCustomerAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {google.cloud.channel.v1.CloudIdentityCustomerAccount} message CloudIdentityCustomerAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudIdentityCustomerAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.existing = false; + object.owned = false; + object.customerName = ""; + object.customerCloudIdentityId = ""; + } + if (message.existing != null && message.hasOwnProperty("existing")) + object.existing = message.existing; + if (message.owned != null && message.hasOwnProperty("owned")) + object.owned = message.owned; + if (message.customerName != null && message.hasOwnProperty("customerName")) + object.customerName = message.customerName; + if (message.customerCloudIdentityId != null && message.hasOwnProperty("customerCloudIdentityId")) + object.customerCloudIdentityId = message.customerCloudIdentityId; + return object; + }; + + /** + * Converts this CloudIdentityCustomerAccount to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @instance + * @returns {Object.} JSON object + */ + CloudIdentityCustomerAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudIdentityCustomerAccount + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CloudIdentityCustomerAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudIdentityCustomerAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CloudIdentityCustomerAccount"; + }; + + return CloudIdentityCustomerAccount; + })(); + + v1.CheckCloudIdentityAccountsExistResponse = (function() { + + /** + * Properties of a CheckCloudIdentityAccountsExistResponse. + * @memberof google.cloud.channel.v1 + * @interface ICheckCloudIdentityAccountsExistResponse + * @property {Array.|null} [cloudIdentityAccounts] CheckCloudIdentityAccountsExistResponse cloudIdentityAccounts + */ + + /** + * Constructs a new CheckCloudIdentityAccountsExistResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CheckCloudIdentityAccountsExistResponse. + * @implements ICheckCloudIdentityAccountsExistResponse + * @constructor + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse=} [properties] Properties to set + */ + function CheckCloudIdentityAccountsExistResponse(properties) { + this.cloudIdentityAccounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckCloudIdentityAccountsExistResponse cloudIdentityAccounts. + * @member {Array.} cloudIdentityAccounts + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @instance + */ + CheckCloudIdentityAccountsExistResponse.prototype.cloudIdentityAccounts = $util.emptyArray; + + /** + * Creates a new CheckCloudIdentityAccountsExistResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse} CheckCloudIdentityAccountsExistResponse instance + */ + CheckCloudIdentityAccountsExistResponse.create = function create(properties) { + return new CheckCloudIdentityAccountsExistResponse(properties); + }; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistResponse message. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse} message CheckCloudIdentityAccountsExistResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCloudIdentityAccountsExistResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudIdentityAccounts != null && message.cloudIdentityAccounts.length) + for (var i = 0; i < message.cloudIdentityAccounts.length; ++i) + $root.google.cloud.channel.v1.CloudIdentityCustomerAccount.encode(message.cloudIdentityAccounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CheckCloudIdentityAccountsExistResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse} message CheckCloudIdentityAccountsExistResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckCloudIdentityAccountsExistResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckCloudIdentityAccountsExistResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse} CheckCloudIdentityAccountsExistResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCloudIdentityAccountsExistResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cloudIdentityAccounts && message.cloudIdentityAccounts.length)) + message.cloudIdentityAccounts = []; + message.cloudIdentityAccounts.push($root.google.cloud.channel.v1.CloudIdentityCustomerAccount.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckCloudIdentityAccountsExistResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse} CheckCloudIdentityAccountsExistResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckCloudIdentityAccountsExistResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckCloudIdentityAccountsExistResponse message. + * @function verify + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckCloudIdentityAccountsExistResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudIdentityAccounts != null && message.hasOwnProperty("cloudIdentityAccounts")) { + if (!Array.isArray(message.cloudIdentityAccounts)) + return "cloudIdentityAccounts: array expected"; + for (var i = 0; i < message.cloudIdentityAccounts.length; ++i) { + var error = $root.google.cloud.channel.v1.CloudIdentityCustomerAccount.verify(message.cloudIdentityAccounts[i]); + if (error) + return "cloudIdentityAccounts." + error; + } + } + return null; + }; + + /** + * Creates a CheckCloudIdentityAccountsExistResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse} CheckCloudIdentityAccountsExistResponse + */ + CheckCloudIdentityAccountsExistResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse) + return object; + var message = new $root.google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse(); + if (object.cloudIdentityAccounts) { + if (!Array.isArray(object.cloudIdentityAccounts)) + throw TypeError(".google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse.cloudIdentityAccounts: array expected"); + message.cloudIdentityAccounts = []; + for (var i = 0; i < object.cloudIdentityAccounts.length; ++i) { + if (typeof object.cloudIdentityAccounts[i] !== "object") + throw TypeError(".google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse.cloudIdentityAccounts: object expected"); + message.cloudIdentityAccounts[i] = $root.google.cloud.channel.v1.CloudIdentityCustomerAccount.fromObject(object.cloudIdentityAccounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CheckCloudIdentityAccountsExistResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse} message CheckCloudIdentityAccountsExistResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckCloudIdentityAccountsExistResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cloudIdentityAccounts = []; + if (message.cloudIdentityAccounts && message.cloudIdentityAccounts.length) { + object.cloudIdentityAccounts = []; + for (var j = 0; j < message.cloudIdentityAccounts.length; ++j) + object.cloudIdentityAccounts[j] = $root.google.cloud.channel.v1.CloudIdentityCustomerAccount.toObject(message.cloudIdentityAccounts[j], options); + } + return object; + }; + + /** + * Converts this CheckCloudIdentityAccountsExistResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @instance + * @returns {Object.} JSON object + */ + CheckCloudIdentityAccountsExistResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckCloudIdentityAccountsExistResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckCloudIdentityAccountsExistResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse"; + }; + + return CheckCloudIdentityAccountsExistResponse; + })(); + + v1.ListCustomersRequest = (function() { + + /** + * Properties of a ListCustomersRequest. + * @memberof google.cloud.channel.v1 + * @interface IListCustomersRequest + * @property {string|null} [parent] ListCustomersRequest parent + * @property {number|null} [pageSize] ListCustomersRequest pageSize + * @property {string|null} [pageToken] ListCustomersRequest pageToken + * @property {string|null} [filter] ListCustomersRequest filter + */ + + /** + * Constructs a new ListCustomersRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListCustomersRequest. + * @implements IListCustomersRequest + * @constructor + * @param {google.cloud.channel.v1.IListCustomersRequest=} [properties] Properties to set + */ + function ListCustomersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomersRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @instance + */ + ListCustomersRequest.prototype.parent = ""; + + /** + * ListCustomersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @instance + */ + ListCustomersRequest.prototype.pageSize = 0; + + /** + * ListCustomersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @instance + */ + ListCustomersRequest.prototype.pageToken = ""; + + /** + * ListCustomersRequest filter. + * @member {string} filter + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @instance + */ + ListCustomersRequest.prototype.filter = ""; + + /** + * Creates a new ListCustomersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {google.cloud.channel.v1.IListCustomersRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListCustomersRequest} ListCustomersRequest instance + */ + ListCustomersRequest.create = function create(properties) { + return new ListCustomersRequest(properties); + }; + + /** + * Encodes the specified ListCustomersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListCustomersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {google.cloud.channel.v1.IListCustomersRequest} message ListCustomersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListCustomersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {google.cloud.channel.v1.IListCustomersRequest} message ListCustomersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListCustomersRequest} ListCustomersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListCustomersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListCustomersRequest} ListCustomersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomersRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListCustomersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListCustomersRequest} ListCustomersRequest + */ + ListCustomersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListCustomersRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListCustomersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListCustomersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {google.cloud.channel.v1.ListCustomersRequest} message ListCustomersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListCustomersRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @instance + * @returns {Object.} JSON object + */ + ListCustomersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomersRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListCustomersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListCustomersRequest"; + }; + + return ListCustomersRequest; + })(); + + v1.ListCustomersResponse = (function() { + + /** + * Properties of a ListCustomersResponse. + * @memberof google.cloud.channel.v1 + * @interface IListCustomersResponse + * @property {Array.|null} [customers] ListCustomersResponse customers + * @property {string|null} [nextPageToken] ListCustomersResponse nextPageToken + */ + + /** + * Constructs a new ListCustomersResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListCustomersResponse. + * @implements IListCustomersResponse + * @constructor + * @param {google.cloud.channel.v1.IListCustomersResponse=} [properties] Properties to set + */ + function ListCustomersResponse(properties) { + this.customers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomersResponse customers. + * @member {Array.} customers + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @instance + */ + ListCustomersResponse.prototype.customers = $util.emptyArray; + + /** + * ListCustomersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @instance + */ + ListCustomersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCustomersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {google.cloud.channel.v1.IListCustomersResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListCustomersResponse} ListCustomersResponse instance + */ + ListCustomersResponse.create = function create(properties) { + return new ListCustomersResponse(properties); + }; + + /** + * Encodes the specified ListCustomersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListCustomersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {google.cloud.channel.v1.IListCustomersResponse} message ListCustomersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customers != null && message.customers.length) + for (var i = 0; i < message.customers.length; ++i) + $root.google.cloud.channel.v1.Customer.encode(message.customers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {google.cloud.channel.v1.IListCustomersResponse} message ListCustomersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListCustomersResponse} ListCustomersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListCustomersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.customers && message.customers.length)) + message.customers = []; + message.customers.push($root.google.cloud.channel.v1.Customer.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListCustomersResponse} ListCustomersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomersResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customers != null && message.hasOwnProperty("customers")) { + if (!Array.isArray(message.customers)) + return "customers: array expected"; + for (var i = 0; i < message.customers.length; ++i) { + var error = $root.google.cloud.channel.v1.Customer.verify(message.customers[i]); + if (error) + return "customers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListCustomersResponse} ListCustomersResponse + */ + ListCustomersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListCustomersResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListCustomersResponse(); + if (object.customers) { + if (!Array.isArray(object.customers)) + throw TypeError(".google.cloud.channel.v1.ListCustomersResponse.customers: array expected"); + message.customers = []; + for (var i = 0; i < object.customers.length; ++i) { + if (typeof object.customers[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListCustomersResponse.customers: object expected"); + message.customers[i] = $root.google.cloud.channel.v1.Customer.fromObject(object.customers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {google.cloud.channel.v1.ListCustomersResponse} message ListCustomersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.customers && message.customers.length) { + object.customers = []; + for (var j = 0; j < message.customers.length; ++j) + object.customers[j] = $root.google.cloud.channel.v1.Customer.toObject(message.customers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCustomersResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @instance + * @returns {Object.} JSON object + */ + ListCustomersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomersResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListCustomersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListCustomersResponse"; + }; + + return ListCustomersResponse; + })(); + + v1.GetCustomerRequest = (function() { + + /** + * Properties of a GetCustomerRequest. + * @memberof google.cloud.channel.v1 + * @interface IGetCustomerRequest + * @property {string|null} [name] GetCustomerRequest name + */ + + /** + * Constructs a new GetCustomerRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a GetCustomerRequest. + * @implements IGetCustomerRequest + * @constructor + * @param {google.cloud.channel.v1.IGetCustomerRequest=} [properties] Properties to set + */ + function GetCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCustomerRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @instance + */ + GetCustomerRequest.prototype.name = ""; + + /** + * Creates a new GetCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {google.cloud.channel.v1.IGetCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.GetCustomerRequest} GetCustomerRequest instance + */ + GetCustomerRequest.create = function create(properties) { + return new GetCustomerRequest(properties); + }; + + /** + * Encodes the specified GetCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {google.cloud.channel.v1.IGetCustomerRequest} message GetCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomerRequest.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 GetCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {google.cloud.channel.v1.IGetCustomerRequest} message GetCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.GetCustomerRequest} GetCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.GetCustomerRequest(); + 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 GetCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.GetCustomerRequest} GetCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCustomerRequest message. + * @function verify + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCustomerRequest.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 GetCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.GetCustomerRequest} GetCustomerRequest + */ + GetCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.GetCustomerRequest) + return object; + var message = new $root.google.cloud.channel.v1.GetCustomerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {google.cloud.channel.v1.GetCustomerRequest} message GetCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCustomerRequest.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 GetCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + GetCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.GetCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.GetCustomerRequest"; + }; + + return GetCustomerRequest; + })(); + + v1.CreateCustomerRequest = (function() { + + /** + * Properties of a CreateCustomerRequest. + * @memberof google.cloud.channel.v1 + * @interface ICreateCustomerRequest + * @property {string|null} [parent] CreateCustomerRequest parent + * @property {google.cloud.channel.v1.ICustomer|null} [customer] CreateCustomerRequest customer + */ + + /** + * Constructs a new CreateCustomerRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CreateCustomerRequest. + * @implements ICreateCustomerRequest + * @constructor + * @param {google.cloud.channel.v1.ICreateCustomerRequest=} [properties] Properties to set + */ + function CreateCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomerRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @instance + */ + CreateCustomerRequest.prototype.parent = ""; + + /** + * CreateCustomerRequest customer. + * @member {google.cloud.channel.v1.ICustomer|null|undefined} customer + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @instance + */ + CreateCustomerRequest.prototype.customer = null; + + /** + * Creates a new CreateCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {google.cloud.channel.v1.ICreateCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CreateCustomerRequest} CreateCustomerRequest instance + */ + CreateCustomerRequest.create = function create(properties) { + return new CreateCustomerRequest(properties); + }; + + /** + * Encodes the specified CreateCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {google.cloud.channel.v1.ICreateCustomerRequest} message CreateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomerRequest.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.customer != null && Object.hasOwnProperty.call(message, "customer")) + $root.google.cloud.channel.v1.Customer.encode(message.customer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {google.cloud.channel.v1.ICreateCustomerRequest} message CreateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CreateCustomerRequest} CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CreateCustomerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customer = $root.google.cloud.channel.v1.Customer.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CreateCustomerRequest} CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomerRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomerRequest.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.customer != null && message.hasOwnProperty("customer")) { + var error = $root.google.cloud.channel.v1.Customer.verify(message.customer); + if (error) + return "customer." + error; + } + return null; + }; + + /** + * Creates a CreateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CreateCustomerRequest} CreateCustomerRequest + */ + CreateCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CreateCustomerRequest) + return object; + var message = new $root.google.cloud.channel.v1.CreateCustomerRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customer != null) { + if (typeof object.customer !== "object") + throw TypeError(".google.cloud.channel.v1.CreateCustomerRequest.customer: object expected"); + message.customer = $root.google.cloud.channel.v1.Customer.fromObject(object.customer); + } + return message; + }; + + /** + * Creates a plain object from a CreateCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {google.cloud.channel.v1.CreateCustomerRequest} message CreateCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customer = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = $root.google.cloud.channel.v1.Customer.toObject(message.customer, options); + return object; + }; + + /** + * Converts this CreateCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CreateCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CreateCustomerRequest"; + }; + + return CreateCustomerRequest; + })(); + + v1.UpdateCustomerRequest = (function() { + + /** + * Properties of an UpdateCustomerRequest. + * @memberof google.cloud.channel.v1 + * @interface IUpdateCustomerRequest + * @property {google.cloud.channel.v1.ICustomer|null} [customer] UpdateCustomerRequest customer + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomerRequest updateMask + */ + + /** + * Constructs a new UpdateCustomerRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an UpdateCustomerRequest. + * @implements IUpdateCustomerRequest + * @constructor + * @param {google.cloud.channel.v1.IUpdateCustomerRequest=} [properties] Properties to set + */ + function UpdateCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomerRequest customer. + * @member {google.cloud.channel.v1.ICustomer|null|undefined} customer + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @instance + */ + UpdateCustomerRequest.prototype.customer = null; + + /** + * UpdateCustomerRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @instance + */ + UpdateCustomerRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {google.cloud.channel.v1.IUpdateCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.UpdateCustomerRequest} UpdateCustomerRequest instance + */ + UpdateCustomerRequest.create = function create(properties) { + return new UpdateCustomerRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {google.cloud.channel.v1.IUpdateCustomerRequest} message UpdateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + $root.google.cloud.channel.v1.Customer.encode(message.customer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {google.cloud.channel.v1.IUpdateCustomerRequest} message UpdateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.UpdateCustomerRequest} UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.UpdateCustomerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.customer = $root.google.cloud.channel.v1.Customer.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.UpdateCustomerRequest} UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomerRequest message. + * @function verify + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customer != null && message.hasOwnProperty("customer")) { + var error = $root.google.cloud.channel.v1.Customer.verify(message.customer); + if (error) + return "customer." + 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 UpdateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.UpdateCustomerRequest} UpdateCustomerRequest + */ + UpdateCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.UpdateCustomerRequest) + return object; + var message = new $root.google.cloud.channel.v1.UpdateCustomerRequest(); + if (object.customer != null) { + if (typeof object.customer !== "object") + throw TypeError(".google.cloud.channel.v1.UpdateCustomerRequest.customer: object expected"); + message.customer = $root.google.cloud.channel.v1.Customer.fromObject(object.customer); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.channel.v1.UpdateCustomerRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {google.cloud.channel.v1.UpdateCustomerRequest} message UpdateCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customer = null; + object.updateMask = null; + } + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = $root.google.cloud.channel.v1.Customer.toObject(message.customer, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.UpdateCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.UpdateCustomerRequest"; + }; + + return UpdateCustomerRequest; + })(); + + v1.DeleteCustomerRequest = (function() { + + /** + * Properties of a DeleteCustomerRequest. + * @memberof google.cloud.channel.v1 + * @interface IDeleteCustomerRequest + * @property {string|null} [name] DeleteCustomerRequest name + */ + + /** + * Constructs a new DeleteCustomerRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a DeleteCustomerRequest. + * @implements IDeleteCustomerRequest + * @constructor + * @param {google.cloud.channel.v1.IDeleteCustomerRequest=} [properties] Properties to set + */ + function DeleteCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomerRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @instance + */ + DeleteCustomerRequest.prototype.name = ""; + + /** + * Creates a new DeleteCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {google.cloud.channel.v1.IDeleteCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.DeleteCustomerRequest} DeleteCustomerRequest instance + */ + DeleteCustomerRequest.create = function create(properties) { + return new DeleteCustomerRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {google.cloud.channel.v1.IDeleteCustomerRequest} message DeleteCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomerRequest.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 DeleteCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {google.cloud.channel.v1.IDeleteCustomerRequest} message DeleteCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.DeleteCustomerRequest} DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.DeleteCustomerRequest(); + 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 DeleteCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.DeleteCustomerRequest} DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomerRequest message. + * @function verify + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomerRequest.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 DeleteCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.DeleteCustomerRequest} DeleteCustomerRequest + */ + DeleteCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.DeleteCustomerRequest) + return object; + var message = new $root.google.cloud.channel.v1.DeleteCustomerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {google.cloud.channel.v1.DeleteCustomerRequest} message DeleteCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomerRequest.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 DeleteCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.DeleteCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.DeleteCustomerRequest"; + }; + + return DeleteCustomerRequest; + })(); + + v1.ImportCustomerRequest = (function() { + + /** + * Properties of an ImportCustomerRequest. + * @memberof google.cloud.channel.v1 + * @interface IImportCustomerRequest + * @property {string|null} [domain] ImportCustomerRequest domain + * @property {string|null} [cloudIdentityId] ImportCustomerRequest cloudIdentityId + * @property {string|null} [parent] ImportCustomerRequest parent + * @property {string|null} [authToken] ImportCustomerRequest authToken + * @property {boolean|null} [overwriteIfExists] ImportCustomerRequest overwriteIfExists + * @property {string|null} [channelPartnerId] ImportCustomerRequest channelPartnerId + * @property {string|null} [customer] ImportCustomerRequest customer + */ + + /** + * Constructs a new ImportCustomerRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an ImportCustomerRequest. + * @implements IImportCustomerRequest + * @constructor + * @param {google.cloud.channel.v1.IImportCustomerRequest=} [properties] Properties to set + */ + function ImportCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportCustomerRequest domain. + * @member {string|null|undefined} domain + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.domain = null; + + /** + * ImportCustomerRequest cloudIdentityId. + * @member {string|null|undefined} cloudIdentityId + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.cloudIdentityId = null; + + /** + * ImportCustomerRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.parent = ""; + + /** + * ImportCustomerRequest authToken. + * @member {string} authToken + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.authToken = ""; + + /** + * ImportCustomerRequest overwriteIfExists. + * @member {boolean} overwriteIfExists + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.overwriteIfExists = false; + + /** + * ImportCustomerRequest channelPartnerId. + * @member {string} channelPartnerId + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.channelPartnerId = ""; + + /** + * ImportCustomerRequest customer. + * @member {string} customer + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + ImportCustomerRequest.prototype.customer = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportCustomerRequest customerIdentity. + * @member {"domain"|"cloudIdentityId"|undefined} customerIdentity + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + */ + Object.defineProperty(ImportCustomerRequest.prototype, "customerIdentity", { + get: $util.oneOfGetter($oneOfFields = ["domain", "cloudIdentityId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {google.cloud.channel.v1.IImportCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ImportCustomerRequest} ImportCustomerRequest instance + */ + ImportCustomerRequest.create = function create(properties) { + return new ImportCustomerRequest(properties); + }; + + /** + * Encodes the specified ImportCustomerRequest message. Does not implicitly {@link google.cloud.channel.v1.ImportCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {google.cloud.channel.v1.IImportCustomerRequest} message ImportCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCustomerRequest.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.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain); + if (message.cloudIdentityId != null && Object.hasOwnProperty.call(message, "cloudIdentityId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cloudIdentityId); + if (message.authToken != null && Object.hasOwnProperty.call(message, "authToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authToken); + if (message.overwriteIfExists != null && Object.hasOwnProperty.call(message, "overwriteIfExists")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.overwriteIfExists); + if (message.channelPartnerId != null && Object.hasOwnProperty.call(message, "channelPartnerId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.channelPartnerId); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.customer); + return writer; + }; + + /** + * Encodes the specified ImportCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ImportCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {google.cloud.channel.v1.IImportCustomerRequest} message ImportCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ImportCustomerRequest} ImportCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ImportCustomerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.domain = reader.string(); + break; + } + case 3: { + message.cloudIdentityId = reader.string(); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.authToken = reader.string(); + break; + } + case 5: { + message.overwriteIfExists = reader.bool(); + break; + } + case 6: { + message.channelPartnerId = reader.string(); + break; + } + case 7: { + message.customer = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ImportCustomerRequest} ImportCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportCustomerRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportCustomerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.domain != null && message.hasOwnProperty("domain")) { + properties.customerIdentity = 1; + if (!$util.isString(message.domain)) + return "domain: string expected"; + } + if (message.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) { + if (properties.customerIdentity === 1) + return "customerIdentity: multiple values"; + properties.customerIdentity = 1; + if (!$util.isString(message.cloudIdentityId)) + return "cloudIdentityId: string expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.authToken != null && message.hasOwnProperty("authToken")) + if (!$util.isString(message.authToken)) + return "authToken: string expected"; + if (message.overwriteIfExists != null && message.hasOwnProperty("overwriteIfExists")) + if (typeof message.overwriteIfExists !== "boolean") + return "overwriteIfExists: boolean expected"; + if (message.channelPartnerId != null && message.hasOwnProperty("channelPartnerId")) + if (!$util.isString(message.channelPartnerId)) + return "channelPartnerId: string expected"; + if (message.customer != null && message.hasOwnProperty("customer")) + if (!$util.isString(message.customer)) + return "customer: string expected"; + return null; + }; + + /** + * Creates an ImportCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ImportCustomerRequest} ImportCustomerRequest + */ + ImportCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ImportCustomerRequest) + return object; + var message = new $root.google.cloud.channel.v1.ImportCustomerRequest(); + if (object.domain != null) + message.domain = String(object.domain); + if (object.cloudIdentityId != null) + message.cloudIdentityId = String(object.cloudIdentityId); + if (object.parent != null) + message.parent = String(object.parent); + if (object.authToken != null) + message.authToken = String(object.authToken); + if (object.overwriteIfExists != null) + message.overwriteIfExists = Boolean(object.overwriteIfExists); + if (object.channelPartnerId != null) + message.channelPartnerId = String(object.channelPartnerId); + if (object.customer != null) + message.customer = String(object.customer); + return message; + }; + + /** + * Creates a plain object from an ImportCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {google.cloud.channel.v1.ImportCustomerRequest} message ImportCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportCustomerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.authToken = ""; + object.overwriteIfExists = false; + object.channelPartnerId = ""; + object.customer = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.domain != null && message.hasOwnProperty("domain")) { + object.domain = message.domain; + if (options.oneofs) + object.customerIdentity = "domain"; + } + if (message.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) { + object.cloudIdentityId = message.cloudIdentityId; + if (options.oneofs) + object.customerIdentity = "cloudIdentityId"; + } + if (message.authToken != null && message.hasOwnProperty("authToken")) + object.authToken = message.authToken; + if (message.overwriteIfExists != null && message.hasOwnProperty("overwriteIfExists")) + object.overwriteIfExists = message.overwriteIfExists; + if (message.channelPartnerId != null && message.hasOwnProperty("channelPartnerId")) + object.channelPartnerId = message.channelPartnerId; + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = message.customer; + return object; + }; + + /** + * Converts this ImportCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + ImportCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ImportCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ImportCustomerRequest"; + }; + + return ImportCustomerRequest; + })(); + + v1.ProvisionCloudIdentityRequest = (function() { + + /** + * Properties of a ProvisionCloudIdentityRequest. + * @memberof google.cloud.channel.v1 + * @interface IProvisionCloudIdentityRequest + * @property {string|null} [customer] ProvisionCloudIdentityRequest customer + * @property {google.cloud.channel.v1.ICloudIdentityInfo|null} [cloudIdentityInfo] ProvisionCloudIdentityRequest cloudIdentityInfo + * @property {google.cloud.channel.v1.IAdminUser|null} [user] ProvisionCloudIdentityRequest user + * @property {boolean|null} [validateOnly] ProvisionCloudIdentityRequest validateOnly + */ + + /** + * Constructs a new ProvisionCloudIdentityRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ProvisionCloudIdentityRequest. + * @implements IProvisionCloudIdentityRequest + * @constructor + * @param {google.cloud.channel.v1.IProvisionCloudIdentityRequest=} [properties] Properties to set + */ + function ProvisionCloudIdentityRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProvisionCloudIdentityRequest customer. + * @member {string} customer + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @instance + */ + ProvisionCloudIdentityRequest.prototype.customer = ""; + + /** + * ProvisionCloudIdentityRequest cloudIdentityInfo. + * @member {google.cloud.channel.v1.ICloudIdentityInfo|null|undefined} cloudIdentityInfo + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @instance + */ + ProvisionCloudIdentityRequest.prototype.cloudIdentityInfo = null; + + /** + * ProvisionCloudIdentityRequest user. + * @member {google.cloud.channel.v1.IAdminUser|null|undefined} user + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @instance + */ + ProvisionCloudIdentityRequest.prototype.user = null; + + /** + * ProvisionCloudIdentityRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @instance + */ + ProvisionCloudIdentityRequest.prototype.validateOnly = false; + + /** + * Creates a new ProvisionCloudIdentityRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {google.cloud.channel.v1.IProvisionCloudIdentityRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ProvisionCloudIdentityRequest} ProvisionCloudIdentityRequest instance + */ + ProvisionCloudIdentityRequest.create = function create(properties) { + return new ProvisionCloudIdentityRequest(properties); + }; + + /** + * Encodes the specified ProvisionCloudIdentityRequest message. Does not implicitly {@link google.cloud.channel.v1.ProvisionCloudIdentityRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {google.cloud.channel.v1.IProvisionCloudIdentityRequest} message ProvisionCloudIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisionCloudIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.customer); + if (message.cloudIdentityInfo != null && Object.hasOwnProperty.call(message, "cloudIdentityInfo")) + $root.google.cloud.channel.v1.CloudIdentityInfo.encode(message.cloudIdentityInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.cloud.channel.v1.AdminUser.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified ProvisionCloudIdentityRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ProvisionCloudIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {google.cloud.channel.v1.IProvisionCloudIdentityRequest} message ProvisionCloudIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisionCloudIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProvisionCloudIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ProvisionCloudIdentityRequest} ProvisionCloudIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisionCloudIdentityRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ProvisionCloudIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customer = reader.string(); + break; + } + case 2: { + message.cloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.user = $root.google.cloud.channel.v1.AdminUser.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProvisionCloudIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ProvisionCloudIdentityRequest} ProvisionCloudIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisionCloudIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProvisionCloudIdentityRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProvisionCloudIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customer != null && message.hasOwnProperty("customer")) + if (!$util.isString(message.customer)) + return "customer: string expected"; + if (message.cloudIdentityInfo != null && message.hasOwnProperty("cloudIdentityInfo")) { + var error = $root.google.cloud.channel.v1.CloudIdentityInfo.verify(message.cloudIdentityInfo); + if (error) + return "cloudIdentityInfo." + error; + } + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.cloud.channel.v1.AdminUser.verify(message.user); + if (error) + return "user." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a ProvisionCloudIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ProvisionCloudIdentityRequest} ProvisionCloudIdentityRequest + */ + ProvisionCloudIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ProvisionCloudIdentityRequest) + return object; + var message = new $root.google.cloud.channel.v1.ProvisionCloudIdentityRequest(); + if (object.customer != null) + message.customer = String(object.customer); + if (object.cloudIdentityInfo != null) { + if (typeof object.cloudIdentityInfo !== "object") + throw TypeError(".google.cloud.channel.v1.ProvisionCloudIdentityRequest.cloudIdentityInfo: object expected"); + message.cloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.fromObject(object.cloudIdentityInfo); + } + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.cloud.channel.v1.ProvisionCloudIdentityRequest.user: object expected"); + message.user = $root.google.cloud.channel.v1.AdminUser.fromObject(object.user); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a ProvisionCloudIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {google.cloud.channel.v1.ProvisionCloudIdentityRequest} message ProvisionCloudIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProvisionCloudIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customer = ""; + object.cloudIdentityInfo = null; + object.user = null; + object.validateOnly = false; + } + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = message.customer; + if (message.cloudIdentityInfo != null && message.hasOwnProperty("cloudIdentityInfo")) + object.cloudIdentityInfo = $root.google.cloud.channel.v1.CloudIdentityInfo.toObject(message.cloudIdentityInfo, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.cloud.channel.v1.AdminUser.toObject(message.user, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this ProvisionCloudIdentityRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + ProvisionCloudIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProvisionCloudIdentityRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ProvisionCloudIdentityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProvisionCloudIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ProvisionCloudIdentityRequest"; + }; + + return ProvisionCloudIdentityRequest; + })(); + + v1.ListEntitlementsRequest = (function() { + + /** + * Properties of a ListEntitlementsRequest. + * @memberof google.cloud.channel.v1 + * @interface IListEntitlementsRequest + * @property {string|null} [parent] ListEntitlementsRequest parent + * @property {number|null} [pageSize] ListEntitlementsRequest pageSize + * @property {string|null} [pageToken] ListEntitlementsRequest pageToken + */ + + /** + * Constructs a new ListEntitlementsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListEntitlementsRequest. + * @implements IListEntitlementsRequest + * @constructor + * @param {google.cloud.channel.v1.IListEntitlementsRequest=} [properties] Properties to set + */ + function ListEntitlementsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntitlementsRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @instance + */ + ListEntitlementsRequest.prototype.parent = ""; + + /** + * ListEntitlementsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @instance + */ + ListEntitlementsRequest.prototype.pageSize = 0; + + /** + * ListEntitlementsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @instance + */ + ListEntitlementsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEntitlementsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.IListEntitlementsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListEntitlementsRequest} ListEntitlementsRequest instance + */ + ListEntitlementsRequest.create = function create(properties) { + return new ListEntitlementsRequest(properties); + }; + + /** + * Encodes the specified ListEntitlementsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.IListEntitlementsRequest} message ListEntitlementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitlementsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListEntitlementsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.IListEntitlementsRequest} message ListEntitlementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitlementsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntitlementsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListEntitlementsRequest} ListEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitlementsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListEntitlementsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntitlementsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListEntitlementsRequest} ListEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitlementsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntitlementsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntitlementsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListEntitlementsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListEntitlementsRequest} ListEntitlementsRequest + */ + ListEntitlementsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListEntitlementsRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListEntitlementsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntitlementsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.ListEntitlementsRequest} message ListEntitlementsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntitlementsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListEntitlementsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEntitlementsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntitlementsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListEntitlementsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntitlementsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListEntitlementsRequest"; + }; + + return ListEntitlementsRequest; + })(); + + v1.ListEntitlementsResponse = (function() { + + /** + * Properties of a ListEntitlementsResponse. + * @memberof google.cloud.channel.v1 + * @interface IListEntitlementsResponse + * @property {Array.|null} [entitlements] ListEntitlementsResponse entitlements + * @property {string|null} [nextPageToken] ListEntitlementsResponse nextPageToken + */ + + /** + * Constructs a new ListEntitlementsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListEntitlementsResponse. + * @implements IListEntitlementsResponse + * @constructor + * @param {google.cloud.channel.v1.IListEntitlementsResponse=} [properties] Properties to set + */ + function ListEntitlementsResponse(properties) { + this.entitlements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEntitlementsResponse entitlements. + * @member {Array.} entitlements + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @instance + */ + ListEntitlementsResponse.prototype.entitlements = $util.emptyArray; + + /** + * ListEntitlementsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @instance + */ + ListEntitlementsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEntitlementsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.IListEntitlementsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListEntitlementsResponse} ListEntitlementsResponse instance + */ + ListEntitlementsResponse.create = function create(properties) { + return new ListEntitlementsResponse(properties); + }; + + /** + * Encodes the specified ListEntitlementsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.IListEntitlementsResponse} message ListEntitlementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitlementsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlements != null && message.entitlements.length) + for (var i = 0; i < message.entitlements.length; ++i) + $root.google.cloud.channel.v1.Entitlement.encode(message.entitlements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListEntitlementsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListEntitlementsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.IListEntitlementsResponse} message ListEntitlementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntitlementsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEntitlementsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListEntitlementsResponse} ListEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitlementsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListEntitlementsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entitlements && message.entitlements.length)) + message.entitlements = []; + message.entitlements.push($root.google.cloud.channel.v1.Entitlement.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEntitlementsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListEntitlementsResponse} ListEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntitlementsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEntitlementsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntitlementsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlements != null && message.hasOwnProperty("entitlements")) { + if (!Array.isArray(message.entitlements)) + return "entitlements: array expected"; + for (var i = 0; i < message.entitlements.length; ++i) { + var error = $root.google.cloud.channel.v1.Entitlement.verify(message.entitlements[i]); + if (error) + return "entitlements." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEntitlementsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListEntitlementsResponse} ListEntitlementsResponse + */ + ListEntitlementsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListEntitlementsResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListEntitlementsResponse(); + if (object.entitlements) { + if (!Array.isArray(object.entitlements)) + throw TypeError(".google.cloud.channel.v1.ListEntitlementsResponse.entitlements: array expected"); + message.entitlements = []; + for (var i = 0; i < object.entitlements.length; ++i) { + if (typeof object.entitlements[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListEntitlementsResponse.entitlements: object expected"); + message.entitlements[i] = $root.google.cloud.channel.v1.Entitlement.fromObject(object.entitlements[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEntitlementsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.ListEntitlementsResponse} message ListEntitlementsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntitlementsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entitlements = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entitlements && message.entitlements.length) { + object.entitlements = []; + for (var j = 0; j < message.entitlements.length; ++j) + object.entitlements[j] = $root.google.cloud.channel.v1.Entitlement.toObject(message.entitlements[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEntitlementsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEntitlementsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEntitlementsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListEntitlementsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEntitlementsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListEntitlementsResponse"; + }; + + return ListEntitlementsResponse; + })(); + + v1.ListTransferableSkusRequest = (function() { + + /** + * Properties of a ListTransferableSkusRequest. + * @memberof google.cloud.channel.v1 + * @interface IListTransferableSkusRequest + * @property {string|null} [cloudIdentityId] ListTransferableSkusRequest cloudIdentityId + * @property {string|null} [customerName] ListTransferableSkusRequest customerName + * @property {string|null} [parent] ListTransferableSkusRequest parent + * @property {number|null} [pageSize] ListTransferableSkusRequest pageSize + * @property {string|null} [pageToken] ListTransferableSkusRequest pageToken + * @property {string|null} [authToken] ListTransferableSkusRequest authToken + * @property {string|null} [languageCode] ListTransferableSkusRequest languageCode + */ + + /** + * Constructs a new ListTransferableSkusRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListTransferableSkusRequest. + * @implements IListTransferableSkusRequest + * @constructor + * @param {google.cloud.channel.v1.IListTransferableSkusRequest=} [properties] Properties to set + */ + function ListTransferableSkusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferableSkusRequest cloudIdentityId. + * @member {string|null|undefined} cloudIdentityId + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.cloudIdentityId = null; + + /** + * ListTransferableSkusRequest customerName. + * @member {string|null|undefined} customerName + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.customerName = null; + + /** + * ListTransferableSkusRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.parent = ""; + + /** + * ListTransferableSkusRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.pageSize = 0; + + /** + * ListTransferableSkusRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.pageToken = ""; + + /** + * ListTransferableSkusRequest authToken. + * @member {string} authToken + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.authToken = ""; + + /** + * ListTransferableSkusRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + ListTransferableSkusRequest.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTransferableSkusRequest transferredCustomerIdentity. + * @member {"cloudIdentityId"|"customerName"|undefined} transferredCustomerIdentity + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + */ + Object.defineProperty(ListTransferableSkusRequest.prototype, "transferredCustomerIdentity", { + get: $util.oneOfGetter($oneOfFields = ["cloudIdentityId", "customerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTransferableSkusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {google.cloud.channel.v1.IListTransferableSkusRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListTransferableSkusRequest} ListTransferableSkusRequest instance + */ + ListTransferableSkusRequest.create = function create(properties) { + return new ListTransferableSkusRequest(properties); + }; + + /** + * Encodes the specified ListTransferableSkusRequest message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {google.cloud.channel.v1.IListTransferableSkusRequest} message ListTransferableSkusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableSkusRequest.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.cloudIdentityId != null && Object.hasOwnProperty.call(message, "cloudIdentityId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudIdentityId); + if (message.authToken != null && Object.hasOwnProperty.call(message, "authToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.authToken); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + if (message.customerName != null && Object.hasOwnProperty.call(message, "customerName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.customerName); + return writer; + }; + + /** + * Encodes the specified ListTransferableSkusRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {google.cloud.channel.v1.IListTransferableSkusRequest} message ListTransferableSkusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableSkusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferableSkusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListTransferableSkusRequest} ListTransferableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableSkusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListTransferableSkusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.cloudIdentityId = reader.string(); + break; + } + case 7: { + message.customerName = 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 5: { + message.authToken = reader.string(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferableSkusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListTransferableSkusRequest} ListTransferableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableSkusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferableSkusRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferableSkusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) { + properties.transferredCustomerIdentity = 1; + if (!$util.isString(message.cloudIdentityId)) + return "cloudIdentityId: string expected"; + } + if (message.customerName != null && message.hasOwnProperty("customerName")) { + if (properties.transferredCustomerIdentity === 1) + return "transferredCustomerIdentity: multiple values"; + properties.transferredCustomerIdentity = 1; + if (!$util.isString(message.customerName)) + return "customerName: string 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.authToken != null && message.hasOwnProperty("authToken")) + if (!$util.isString(message.authToken)) + return "authToken: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListTransferableSkusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListTransferableSkusRequest} ListTransferableSkusRequest + */ + ListTransferableSkusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListTransferableSkusRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListTransferableSkusRequest(); + if (object.cloudIdentityId != null) + message.cloudIdentityId = String(object.cloudIdentityId); + if (object.customerName != null) + message.customerName = String(object.customerName); + 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.authToken != null) + message.authToken = String(object.authToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListTransferableSkusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {google.cloud.channel.v1.ListTransferableSkusRequest} message ListTransferableSkusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferableSkusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.authToken = ""; + object.languageCode = ""; + } + 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.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) { + object.cloudIdentityId = message.cloudIdentityId; + if (options.oneofs) + object.transferredCustomerIdentity = "cloudIdentityId"; + } + if (message.authToken != null && message.hasOwnProperty("authToken")) + object.authToken = message.authToken; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.customerName != null && message.hasOwnProperty("customerName")) { + object.customerName = message.customerName; + if (options.oneofs) + object.transferredCustomerIdentity = "customerName"; + } + return object; + }; + + /** + * Converts this ListTransferableSkusRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferableSkusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferableSkusRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListTransferableSkusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferableSkusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListTransferableSkusRequest"; + }; + + return ListTransferableSkusRequest; + })(); + + v1.ListTransferableSkusResponse = (function() { + + /** + * Properties of a ListTransferableSkusResponse. + * @memberof google.cloud.channel.v1 + * @interface IListTransferableSkusResponse + * @property {Array.|null} [transferableSkus] ListTransferableSkusResponse transferableSkus + * @property {string|null} [nextPageToken] ListTransferableSkusResponse nextPageToken + */ + + /** + * Constructs a new ListTransferableSkusResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListTransferableSkusResponse. + * @implements IListTransferableSkusResponse + * @constructor + * @param {google.cloud.channel.v1.IListTransferableSkusResponse=} [properties] Properties to set + */ + function ListTransferableSkusResponse(properties) { + this.transferableSkus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferableSkusResponse transferableSkus. + * @member {Array.} transferableSkus + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @instance + */ + ListTransferableSkusResponse.prototype.transferableSkus = $util.emptyArray; + + /** + * ListTransferableSkusResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @instance + */ + ListTransferableSkusResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferableSkusResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {google.cloud.channel.v1.IListTransferableSkusResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListTransferableSkusResponse} ListTransferableSkusResponse instance + */ + ListTransferableSkusResponse.create = function create(properties) { + return new ListTransferableSkusResponse(properties); + }; + + /** + * Encodes the specified ListTransferableSkusResponse message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {google.cloud.channel.v1.IListTransferableSkusResponse} message ListTransferableSkusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableSkusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferableSkus != null && message.transferableSkus.length) + for (var i = 0; i < message.transferableSkus.length; ++i) + $root.google.cloud.channel.v1.TransferableSku.encode(message.transferableSkus[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTransferableSkusResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableSkusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {google.cloud.channel.v1.IListTransferableSkusResponse} message ListTransferableSkusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableSkusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferableSkusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListTransferableSkusResponse} ListTransferableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableSkusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListTransferableSkusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferableSkus && message.transferableSkus.length)) + message.transferableSkus = []; + message.transferableSkus.push($root.google.cloud.channel.v1.TransferableSku.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferableSkusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListTransferableSkusResponse} ListTransferableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableSkusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferableSkusResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferableSkusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferableSkus != null && message.hasOwnProperty("transferableSkus")) { + if (!Array.isArray(message.transferableSkus)) + return "transferableSkus: array expected"; + for (var i = 0; i < message.transferableSkus.length; ++i) { + var error = $root.google.cloud.channel.v1.TransferableSku.verify(message.transferableSkus[i]); + if (error) + return "transferableSkus." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferableSkusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListTransferableSkusResponse} ListTransferableSkusResponse + */ + ListTransferableSkusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListTransferableSkusResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListTransferableSkusResponse(); + if (object.transferableSkus) { + if (!Array.isArray(object.transferableSkus)) + throw TypeError(".google.cloud.channel.v1.ListTransferableSkusResponse.transferableSkus: array expected"); + message.transferableSkus = []; + for (var i = 0; i < object.transferableSkus.length; ++i) { + if (typeof object.transferableSkus[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListTransferableSkusResponse.transferableSkus: object expected"); + message.transferableSkus[i] = $root.google.cloud.channel.v1.TransferableSku.fromObject(object.transferableSkus[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferableSkusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {google.cloud.channel.v1.ListTransferableSkusResponse} message ListTransferableSkusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferableSkusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferableSkus = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferableSkus && message.transferableSkus.length) { + object.transferableSkus = []; + for (var j = 0; j < message.transferableSkus.length; ++j) + object.transferableSkus[j] = $root.google.cloud.channel.v1.TransferableSku.toObject(message.transferableSkus[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferableSkusResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferableSkusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferableSkusResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListTransferableSkusResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferableSkusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListTransferableSkusResponse"; + }; + + return ListTransferableSkusResponse; + })(); + + v1.ListTransferableOffersRequest = (function() { + + /** + * Properties of a ListTransferableOffersRequest. + * @memberof google.cloud.channel.v1 + * @interface IListTransferableOffersRequest + * @property {string|null} [cloudIdentityId] ListTransferableOffersRequest cloudIdentityId + * @property {string|null} [customerName] ListTransferableOffersRequest customerName + * @property {string|null} [parent] ListTransferableOffersRequest parent + * @property {number|null} [pageSize] ListTransferableOffersRequest pageSize + * @property {string|null} [pageToken] ListTransferableOffersRequest pageToken + * @property {string|null} [sku] ListTransferableOffersRequest sku + * @property {string|null} [languageCode] ListTransferableOffersRequest languageCode + */ + + /** + * Constructs a new ListTransferableOffersRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListTransferableOffersRequest. + * @implements IListTransferableOffersRequest + * @constructor + * @param {google.cloud.channel.v1.IListTransferableOffersRequest=} [properties] Properties to set + */ + function ListTransferableOffersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferableOffersRequest cloudIdentityId. + * @member {string|null|undefined} cloudIdentityId + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.cloudIdentityId = null; + + /** + * ListTransferableOffersRequest customerName. + * @member {string|null|undefined} customerName + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.customerName = null; + + /** + * ListTransferableOffersRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.parent = ""; + + /** + * ListTransferableOffersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.pageSize = 0; + + /** + * ListTransferableOffersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.pageToken = ""; + + /** + * ListTransferableOffersRequest sku. + * @member {string} sku + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.sku = ""; + + /** + * ListTransferableOffersRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTransferableOffersRequest transferredCustomerIdentity. + * @member {"cloudIdentityId"|"customerName"|undefined} transferredCustomerIdentity + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + Object.defineProperty(ListTransferableOffersRequest.prototype, "transferredCustomerIdentity", { + get: $util.oneOfGetter($oneOfFields = ["cloudIdentityId", "customerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTransferableOffersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {google.cloud.channel.v1.IListTransferableOffersRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListTransferableOffersRequest} ListTransferableOffersRequest instance + */ + ListTransferableOffersRequest.create = function create(properties) { + return new ListTransferableOffersRequest(properties); + }; + + /** + * Encodes the specified ListTransferableOffersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {google.cloud.channel.v1.IListTransferableOffersRequest} message ListTransferableOffersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableOffersRequest.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.cloudIdentityId != null && Object.hasOwnProperty.call(message, "cloudIdentityId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudIdentityId); + if (message.customerName != null && Object.hasOwnProperty.call(message, "customerName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.customerName); + if (message.sku != null && Object.hasOwnProperty.call(message, "sku")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sku); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListTransferableOffersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {google.cloud.channel.v1.IListTransferableOffersRequest} message ListTransferableOffersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableOffersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferableOffersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListTransferableOffersRequest} ListTransferableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableOffersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListTransferableOffersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.cloudIdentityId = reader.string(); + break; + } + case 5: { + message.customerName = 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 6: { + message.sku = reader.string(); + break; + } + case 7: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferableOffersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListTransferableOffersRequest} ListTransferableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableOffersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferableOffersRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferableOffersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) { + properties.transferredCustomerIdentity = 1; + if (!$util.isString(message.cloudIdentityId)) + return "cloudIdentityId: string expected"; + } + if (message.customerName != null && message.hasOwnProperty("customerName")) { + if (properties.transferredCustomerIdentity === 1) + return "transferredCustomerIdentity: multiple values"; + properties.transferredCustomerIdentity = 1; + if (!$util.isString(message.customerName)) + return "customerName: string 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.sku != null && message.hasOwnProperty("sku")) + if (!$util.isString(message.sku)) + return "sku: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListTransferableOffersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListTransferableOffersRequest} ListTransferableOffersRequest + */ + ListTransferableOffersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListTransferableOffersRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListTransferableOffersRequest(); + if (object.cloudIdentityId != null) + message.cloudIdentityId = String(object.cloudIdentityId); + if (object.customerName != null) + message.customerName = String(object.customerName); + 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.sku != null) + message.sku = String(object.sku); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListTransferableOffersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {google.cloud.channel.v1.ListTransferableOffersRequest} message ListTransferableOffersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferableOffersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.sku = ""; + object.languageCode = ""; + } + 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.cloudIdentityId != null && message.hasOwnProperty("cloudIdentityId")) { + object.cloudIdentityId = message.cloudIdentityId; + if (options.oneofs) + object.transferredCustomerIdentity = "cloudIdentityId"; + } + if (message.customerName != null && message.hasOwnProperty("customerName")) { + object.customerName = message.customerName; + if (options.oneofs) + object.transferredCustomerIdentity = "customerName"; + } + if (message.sku != null && message.hasOwnProperty("sku")) + object.sku = message.sku; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListTransferableOffersRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + * @returns {Object.} JSON object + */ + ListTransferableOffersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferableOffersRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferableOffersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListTransferableOffersRequest"; + }; + + return ListTransferableOffersRequest; + })(); + + v1.ListTransferableOffersResponse = (function() { + + /** + * Properties of a ListTransferableOffersResponse. + * @memberof google.cloud.channel.v1 + * @interface IListTransferableOffersResponse + * @property {Array.|null} [transferableOffers] ListTransferableOffersResponse transferableOffers + * @property {string|null} [nextPageToken] ListTransferableOffersResponse nextPageToken + */ + + /** + * Constructs a new ListTransferableOffersResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListTransferableOffersResponse. + * @implements IListTransferableOffersResponse + * @constructor + * @param {google.cloud.channel.v1.IListTransferableOffersResponse=} [properties] Properties to set + */ + function ListTransferableOffersResponse(properties) { + this.transferableOffers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTransferableOffersResponse transferableOffers. + * @member {Array.} transferableOffers + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @instance + */ + ListTransferableOffersResponse.prototype.transferableOffers = $util.emptyArray; + + /** + * ListTransferableOffersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @instance + */ + ListTransferableOffersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTransferableOffersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {google.cloud.channel.v1.IListTransferableOffersResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListTransferableOffersResponse} ListTransferableOffersResponse instance + */ + ListTransferableOffersResponse.create = function create(properties) { + return new ListTransferableOffersResponse(properties); + }; + + /** + * Encodes the specified ListTransferableOffersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {google.cloud.channel.v1.IListTransferableOffersResponse} message ListTransferableOffersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableOffersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transferableOffers != null && message.transferableOffers.length) + for (var i = 0; i < message.transferableOffers.length; ++i) + $root.google.cloud.channel.v1.TransferableOffer.encode(message.transferableOffers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTransferableOffersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListTransferableOffersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {google.cloud.channel.v1.IListTransferableOffersResponse} message ListTransferableOffersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTransferableOffersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTransferableOffersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListTransferableOffersResponse} ListTransferableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableOffersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListTransferableOffersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.transferableOffers && message.transferableOffers.length)) + message.transferableOffers = []; + message.transferableOffers.push($root.google.cloud.channel.v1.TransferableOffer.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTransferableOffersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListTransferableOffersResponse} ListTransferableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTransferableOffersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTransferableOffersResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTransferableOffersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transferableOffers != null && message.hasOwnProperty("transferableOffers")) { + if (!Array.isArray(message.transferableOffers)) + return "transferableOffers: array expected"; + for (var i = 0; i < message.transferableOffers.length; ++i) { + var error = $root.google.cloud.channel.v1.TransferableOffer.verify(message.transferableOffers[i]); + if (error) + return "transferableOffers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTransferableOffersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListTransferableOffersResponse} ListTransferableOffersResponse + */ + ListTransferableOffersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListTransferableOffersResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListTransferableOffersResponse(); + if (object.transferableOffers) { + if (!Array.isArray(object.transferableOffers)) + throw TypeError(".google.cloud.channel.v1.ListTransferableOffersResponse.transferableOffers: array expected"); + message.transferableOffers = []; + for (var i = 0; i < object.transferableOffers.length; ++i) { + if (typeof object.transferableOffers[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListTransferableOffersResponse.transferableOffers: object expected"); + message.transferableOffers[i] = $root.google.cloud.channel.v1.TransferableOffer.fromObject(object.transferableOffers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTransferableOffersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {google.cloud.channel.v1.ListTransferableOffersResponse} message ListTransferableOffersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTransferableOffersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.transferableOffers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.transferableOffers && message.transferableOffers.length) { + object.transferableOffers = []; + for (var j = 0; j < message.transferableOffers.length; ++j) + object.transferableOffers[j] = $root.google.cloud.channel.v1.TransferableOffer.toObject(message.transferableOffers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTransferableOffersResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @instance + * @returns {Object.} JSON object + */ + ListTransferableOffersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTransferableOffersResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListTransferableOffersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTransferableOffersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListTransferableOffersResponse"; + }; + + return ListTransferableOffersResponse; + })(); + + v1.TransferableOffer = (function() { + + /** + * Properties of a TransferableOffer. + * @memberof google.cloud.channel.v1 + * @interface ITransferableOffer + * @property {google.cloud.channel.v1.IOffer|null} [offer] TransferableOffer offer + */ + + /** + * Constructs a new TransferableOffer. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TransferableOffer. + * @implements ITransferableOffer + * @constructor + * @param {google.cloud.channel.v1.ITransferableOffer=} [properties] Properties to set + */ + function TransferableOffer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferableOffer offer. + * @member {google.cloud.channel.v1.IOffer|null|undefined} offer + * @memberof google.cloud.channel.v1.TransferableOffer + * @instance + */ + TransferableOffer.prototype.offer = null; + + /** + * Creates a new TransferableOffer instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {google.cloud.channel.v1.ITransferableOffer=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TransferableOffer} TransferableOffer instance + */ + TransferableOffer.create = function create(properties) { + return new TransferableOffer(properties); + }; + + /** + * Encodes the specified TransferableOffer message. Does not implicitly {@link google.cloud.channel.v1.TransferableOffer.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {google.cloud.channel.v1.ITransferableOffer} message TransferableOffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferableOffer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + $root.google.cloud.channel.v1.Offer.encode(message.offer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferableOffer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferableOffer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {google.cloud.channel.v1.ITransferableOffer} message TransferableOffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferableOffer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferableOffer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TransferableOffer} TransferableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferableOffer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TransferableOffer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.offer = $root.google.cloud.channel.v1.Offer.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferableOffer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TransferableOffer} TransferableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferableOffer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferableOffer message. + * @function verify + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferableOffer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offer != null && message.hasOwnProperty("offer")) { + var error = $root.google.cloud.channel.v1.Offer.verify(message.offer); + if (error) + return "offer." + error; + } + return null; + }; + + /** + * Creates a TransferableOffer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TransferableOffer} TransferableOffer + */ + TransferableOffer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TransferableOffer) + return object; + var message = new $root.google.cloud.channel.v1.TransferableOffer(); + if (object.offer != null) { + if (typeof object.offer !== "object") + throw TypeError(".google.cloud.channel.v1.TransferableOffer.offer: object expected"); + message.offer = $root.google.cloud.channel.v1.Offer.fromObject(object.offer); + } + return message; + }; + + /** + * Creates a plain object from a TransferableOffer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {google.cloud.channel.v1.TransferableOffer} message TransferableOffer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferableOffer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.offer = null; + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = $root.google.cloud.channel.v1.Offer.toObject(message.offer, options); + return object; + }; + + /** + * Converts this TransferableOffer to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TransferableOffer + * @instance + * @returns {Object.} JSON object + */ + TransferableOffer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferableOffer + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TransferableOffer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferableOffer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TransferableOffer"; + }; + + return TransferableOffer; + })(); + + v1.GetEntitlementRequest = (function() { + + /** + * Properties of a GetEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @interface IGetEntitlementRequest + * @property {string|null} [name] GetEntitlementRequest name + */ + + /** + * Constructs a new GetEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a GetEntitlementRequest. + * @implements IGetEntitlementRequest + * @constructor + * @param {google.cloud.channel.v1.IGetEntitlementRequest=} [properties] Properties to set + */ + function GetEntitlementRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEntitlementRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @instance + */ + GetEntitlementRequest.prototype.name = ""; + + /** + * Creates a new GetEntitlementRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {google.cloud.channel.v1.IGetEntitlementRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.GetEntitlementRequest} GetEntitlementRequest instance + */ + GetEntitlementRequest.create = function create(properties) { + return new GetEntitlementRequest(properties); + }; + + /** + * Encodes the specified GetEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.GetEntitlementRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {google.cloud.channel.v1.IGetEntitlementRequest} message GetEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntitlementRequest.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 GetEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetEntitlementRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {google.cloud.channel.v1.IGetEntitlementRequest} message GetEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntitlementRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEntitlementRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.GetEntitlementRequest} GetEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntitlementRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.GetEntitlementRequest(); + 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 GetEntitlementRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.GetEntitlementRequest} GetEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntitlementRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEntitlementRequest message. + * @function verify + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEntitlementRequest.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 GetEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.GetEntitlementRequest} GetEntitlementRequest + */ + GetEntitlementRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.GetEntitlementRequest) + return object; + var message = new $root.google.cloud.channel.v1.GetEntitlementRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEntitlementRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {google.cloud.channel.v1.GetEntitlementRequest} message GetEntitlementRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEntitlementRequest.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 GetEntitlementRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @instance + * @returns {Object.} JSON object + */ + GetEntitlementRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEntitlementRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.GetEntitlementRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEntitlementRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.GetEntitlementRequest"; + }; + + return GetEntitlementRequest; + })(); + + v1.ListChannelPartnerLinksRequest = (function() { + + /** + * Properties of a ListChannelPartnerLinksRequest. + * @memberof google.cloud.channel.v1 + * @interface IListChannelPartnerLinksRequest + * @property {string|null} [parent] ListChannelPartnerLinksRequest parent + * @property {number|null} [pageSize] ListChannelPartnerLinksRequest pageSize + * @property {string|null} [pageToken] ListChannelPartnerLinksRequest pageToken + * @property {google.cloud.channel.v1.ChannelPartnerLinkView|null} [view] ListChannelPartnerLinksRequest view + */ + + /** + * Constructs a new ListChannelPartnerLinksRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListChannelPartnerLinksRequest. + * @implements IListChannelPartnerLinksRequest + * @constructor + * @param {google.cloud.channel.v1.IListChannelPartnerLinksRequest=} [properties] Properties to set + */ + function ListChannelPartnerLinksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelPartnerLinksRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @instance + */ + ListChannelPartnerLinksRequest.prototype.parent = ""; + + /** + * ListChannelPartnerLinksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @instance + */ + ListChannelPartnerLinksRequest.prototype.pageSize = 0; + + /** + * ListChannelPartnerLinksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @instance + */ + ListChannelPartnerLinksRequest.prototype.pageToken = ""; + + /** + * ListChannelPartnerLinksRequest view. + * @member {google.cloud.channel.v1.ChannelPartnerLinkView} view + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @instance + */ + ListChannelPartnerLinksRequest.prototype.view = 0; + + /** + * Creates a new ListChannelPartnerLinksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerLinksRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksRequest} ListChannelPartnerLinksRequest instance + */ + ListChannelPartnerLinksRequest.create = function create(properties) { + return new ListChannelPartnerLinksRequest(properties); + }; + + /** + * Encodes the specified ListChannelPartnerLinksRequest message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerLinksRequest} message ListChannelPartnerLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerLinksRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListChannelPartnerLinksRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerLinksRequest} message ListChannelPartnerLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelPartnerLinksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksRequest} ListChannelPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerLinksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListChannelPartnerLinksRequest(); + 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.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelPartnerLinksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksRequest} ListChannelPartnerLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerLinksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelPartnerLinksRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelPartnerLinksRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListChannelPartnerLinksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksRequest} ListChannelPartnerLinksRequest + */ + ListChannelPartnerLinksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListChannelPartnerLinksRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListChannelPartnerLinksRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListChannelPartnerLinksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {google.cloud.channel.v1.ListChannelPartnerLinksRequest} message ListChannelPartnerLinksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelPartnerLinksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.channel.v1.ChannelPartnerLinkView[message.view] === undefined ? message.view : $root.google.cloud.channel.v1.ChannelPartnerLinkView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListChannelPartnerLinksRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @instance + * @returns {Object.} JSON object + */ + ListChannelPartnerLinksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelPartnerLinksRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelPartnerLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListChannelPartnerLinksRequest"; + }; + + return ListChannelPartnerLinksRequest; + })(); + + v1.ListChannelPartnerLinksResponse = (function() { + + /** + * Properties of a ListChannelPartnerLinksResponse. + * @memberof google.cloud.channel.v1 + * @interface IListChannelPartnerLinksResponse + * @property {Array.|null} [channelPartnerLinks] ListChannelPartnerLinksResponse channelPartnerLinks + * @property {string|null} [nextPageToken] ListChannelPartnerLinksResponse nextPageToken + */ + + /** + * Constructs a new ListChannelPartnerLinksResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListChannelPartnerLinksResponse. + * @implements IListChannelPartnerLinksResponse + * @constructor + * @param {google.cloud.channel.v1.IListChannelPartnerLinksResponse=} [properties] Properties to set + */ + function ListChannelPartnerLinksResponse(properties) { + this.channelPartnerLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelPartnerLinksResponse channelPartnerLinks. + * @member {Array.} channelPartnerLinks + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @instance + */ + ListChannelPartnerLinksResponse.prototype.channelPartnerLinks = $util.emptyArray; + + /** + * ListChannelPartnerLinksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @instance + */ + ListChannelPartnerLinksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChannelPartnerLinksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerLinksResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksResponse} ListChannelPartnerLinksResponse instance + */ + ListChannelPartnerLinksResponse.create = function create(properties) { + return new ListChannelPartnerLinksResponse(properties); + }; + + /** + * Encodes the specified ListChannelPartnerLinksResponse message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerLinksResponse} message ListChannelPartnerLinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerLinksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelPartnerLinks != null && message.channelPartnerLinks.length) + for (var i = 0; i < message.channelPartnerLinks.length; ++i) + $root.google.cloud.channel.v1.ChannelPartnerLink.encode(message.channelPartnerLinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListChannelPartnerLinksResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerLinksResponse} message ListChannelPartnerLinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelPartnerLinksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksResponse} ListChannelPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerLinksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListChannelPartnerLinksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.channelPartnerLinks && message.channelPartnerLinks.length)) + message.channelPartnerLinks = []; + message.channelPartnerLinks.push($root.google.cloud.channel.v1.ChannelPartnerLink.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelPartnerLinksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksResponse} ListChannelPartnerLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerLinksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelPartnerLinksResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelPartnerLinksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelPartnerLinks != null && message.hasOwnProperty("channelPartnerLinks")) { + if (!Array.isArray(message.channelPartnerLinks)) + return "channelPartnerLinks: array expected"; + for (var i = 0; i < message.channelPartnerLinks.length; ++i) { + var error = $root.google.cloud.channel.v1.ChannelPartnerLink.verify(message.channelPartnerLinks[i]); + if (error) + return "channelPartnerLinks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChannelPartnerLinksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListChannelPartnerLinksResponse} ListChannelPartnerLinksResponse + */ + ListChannelPartnerLinksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListChannelPartnerLinksResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListChannelPartnerLinksResponse(); + if (object.channelPartnerLinks) { + if (!Array.isArray(object.channelPartnerLinks)) + throw TypeError(".google.cloud.channel.v1.ListChannelPartnerLinksResponse.channelPartnerLinks: array expected"); + message.channelPartnerLinks = []; + for (var i = 0; i < object.channelPartnerLinks.length; ++i) { + if (typeof object.channelPartnerLinks[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListChannelPartnerLinksResponse.channelPartnerLinks: object expected"); + message.channelPartnerLinks[i] = $root.google.cloud.channel.v1.ChannelPartnerLink.fromObject(object.channelPartnerLinks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChannelPartnerLinksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {google.cloud.channel.v1.ListChannelPartnerLinksResponse} message ListChannelPartnerLinksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelPartnerLinksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.channelPartnerLinks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.channelPartnerLinks && message.channelPartnerLinks.length) { + object.channelPartnerLinks = []; + for (var j = 0; j < message.channelPartnerLinks.length; ++j) + object.channelPartnerLinks[j] = $root.google.cloud.channel.v1.ChannelPartnerLink.toObject(message.channelPartnerLinks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChannelPartnerLinksResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @instance + * @returns {Object.} JSON object + */ + ListChannelPartnerLinksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelPartnerLinksResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListChannelPartnerLinksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelPartnerLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListChannelPartnerLinksResponse"; + }; + + return ListChannelPartnerLinksResponse; + })(); + + v1.GetChannelPartnerLinkRequest = (function() { + + /** + * Properties of a GetChannelPartnerLinkRequest. + * @memberof google.cloud.channel.v1 + * @interface IGetChannelPartnerLinkRequest + * @property {string|null} [name] GetChannelPartnerLinkRequest name + * @property {google.cloud.channel.v1.ChannelPartnerLinkView|null} [view] GetChannelPartnerLinkRequest view + */ + + /** + * Constructs a new GetChannelPartnerLinkRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a GetChannelPartnerLinkRequest. + * @implements IGetChannelPartnerLinkRequest + * @constructor + * @param {google.cloud.channel.v1.IGetChannelPartnerLinkRequest=} [properties] Properties to set + */ + function GetChannelPartnerLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChannelPartnerLinkRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @instance + */ + GetChannelPartnerLinkRequest.prototype.name = ""; + + /** + * GetChannelPartnerLinkRequest view. + * @member {google.cloud.channel.v1.ChannelPartnerLinkView} view + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @instance + */ + GetChannelPartnerLinkRequest.prototype.view = 0; + + /** + * Creates a new GetChannelPartnerLinkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.IGetChannelPartnerLinkRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.GetChannelPartnerLinkRequest} GetChannelPartnerLinkRequest instance + */ + GetChannelPartnerLinkRequest.create = function create(properties) { + return new GetChannelPartnerLinkRequest(properties); + }; + + /** + * Encodes the specified GetChannelPartnerLinkRequest message. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.IGetChannelPartnerLinkRequest} message GetChannelPartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChannelPartnerLinkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetChannelPartnerLinkRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.IGetChannelPartnerLinkRequest} message GetChannelPartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChannelPartnerLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChannelPartnerLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.GetChannelPartnerLinkRequest} GetChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChannelPartnerLinkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.GetChannelPartnerLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetChannelPartnerLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.GetChannelPartnerLinkRequest} GetChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChannelPartnerLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChannelPartnerLinkRequest message. + * @function verify + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChannelPartnerLinkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetChannelPartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.GetChannelPartnerLinkRequest} GetChannelPartnerLinkRequest + */ + GetChannelPartnerLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.GetChannelPartnerLinkRequest) + return object; + var message = new $root.google.cloud.channel.v1.GetChannelPartnerLinkRequest(); + 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 "UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetChannelPartnerLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.GetChannelPartnerLinkRequest} message GetChannelPartnerLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChannelPartnerLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "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.channel.v1.ChannelPartnerLinkView[message.view] === undefined ? message.view : $root.google.cloud.channel.v1.ChannelPartnerLinkView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetChannelPartnerLinkRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @instance + * @returns {Object.} JSON object + */ + GetChannelPartnerLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChannelPartnerLinkRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.GetChannelPartnerLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChannelPartnerLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.GetChannelPartnerLinkRequest"; + }; + + return GetChannelPartnerLinkRequest; + })(); + + v1.CreateChannelPartnerLinkRequest = (function() { + + /** + * Properties of a CreateChannelPartnerLinkRequest. + * @memberof google.cloud.channel.v1 + * @interface ICreateChannelPartnerLinkRequest + * @property {string|null} [parent] CreateChannelPartnerLinkRequest parent + * @property {google.cloud.channel.v1.IChannelPartnerLink|null} [channelPartnerLink] CreateChannelPartnerLinkRequest channelPartnerLink + */ + + /** + * Constructs a new CreateChannelPartnerLinkRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CreateChannelPartnerLinkRequest. + * @implements ICreateChannelPartnerLinkRequest + * @constructor + * @param {google.cloud.channel.v1.ICreateChannelPartnerLinkRequest=} [properties] Properties to set + */ + function CreateChannelPartnerLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateChannelPartnerLinkRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @instance + */ + CreateChannelPartnerLinkRequest.prototype.parent = ""; + + /** + * CreateChannelPartnerLinkRequest channelPartnerLink. + * @member {google.cloud.channel.v1.IChannelPartnerLink|null|undefined} channelPartnerLink + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @instance + */ + CreateChannelPartnerLinkRequest.prototype.channelPartnerLink = null; + + /** + * Creates a new CreateChannelPartnerLinkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.ICreateChannelPartnerLinkRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CreateChannelPartnerLinkRequest} CreateChannelPartnerLinkRequest instance + */ + CreateChannelPartnerLinkRequest.create = function create(properties) { + return new CreateChannelPartnerLinkRequest(properties); + }; + + /** + * Encodes the specified CreateChannelPartnerLinkRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.ICreateChannelPartnerLinkRequest} message CreateChannelPartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelPartnerLinkRequest.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.channelPartnerLink != null && Object.hasOwnProperty.call(message, "channelPartnerLink")) + $root.google.cloud.channel.v1.ChannelPartnerLink.encode(message.channelPartnerLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateChannelPartnerLinkRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.ICreateChannelPartnerLinkRequest} message CreateChannelPartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelPartnerLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateChannelPartnerLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CreateChannelPartnerLinkRequest} CreateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChannelPartnerLinkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CreateChannelPartnerLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.channelPartnerLink = $root.google.cloud.channel.v1.ChannelPartnerLink.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateChannelPartnerLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CreateChannelPartnerLinkRequest} CreateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChannelPartnerLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateChannelPartnerLinkRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateChannelPartnerLinkRequest.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.channelPartnerLink != null && message.hasOwnProperty("channelPartnerLink")) { + var error = $root.google.cloud.channel.v1.ChannelPartnerLink.verify(message.channelPartnerLink); + if (error) + return "channelPartnerLink." + error; + } + return null; + }; + + /** + * Creates a CreateChannelPartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CreateChannelPartnerLinkRequest} CreateChannelPartnerLinkRequest + */ + CreateChannelPartnerLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CreateChannelPartnerLinkRequest) + return object; + var message = new $root.google.cloud.channel.v1.CreateChannelPartnerLinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.channelPartnerLink != null) { + if (typeof object.channelPartnerLink !== "object") + throw TypeError(".google.cloud.channel.v1.CreateChannelPartnerLinkRequest.channelPartnerLink: object expected"); + message.channelPartnerLink = $root.google.cloud.channel.v1.ChannelPartnerLink.fromObject(object.channelPartnerLink); + } + return message; + }; + + /** + * Creates a plain object from a CreateChannelPartnerLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.CreateChannelPartnerLinkRequest} message CreateChannelPartnerLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateChannelPartnerLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.channelPartnerLink = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.channelPartnerLink != null && message.hasOwnProperty("channelPartnerLink")) + object.channelPartnerLink = $root.google.cloud.channel.v1.ChannelPartnerLink.toObject(message.channelPartnerLink, options); + return object; + }; + + /** + * Converts this CreateChannelPartnerLinkRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @instance + * @returns {Object.} JSON object + */ + CreateChannelPartnerLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateChannelPartnerLinkRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CreateChannelPartnerLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateChannelPartnerLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CreateChannelPartnerLinkRequest"; + }; + + return CreateChannelPartnerLinkRequest; + })(); + + v1.UpdateChannelPartnerLinkRequest = (function() { + + /** + * Properties of an UpdateChannelPartnerLinkRequest. + * @memberof google.cloud.channel.v1 + * @interface IUpdateChannelPartnerLinkRequest + * @property {string|null} [name] UpdateChannelPartnerLinkRequest name + * @property {google.cloud.channel.v1.IChannelPartnerLink|null} [channelPartnerLink] UpdateChannelPartnerLinkRequest channelPartnerLink + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChannelPartnerLinkRequest updateMask + */ + + /** + * Constructs a new UpdateChannelPartnerLinkRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an UpdateChannelPartnerLinkRequest. + * @implements IUpdateChannelPartnerLinkRequest + * @constructor + * @param {google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest=} [properties] Properties to set + */ + function UpdateChannelPartnerLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateChannelPartnerLinkRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @instance + */ + UpdateChannelPartnerLinkRequest.prototype.name = ""; + + /** + * UpdateChannelPartnerLinkRequest channelPartnerLink. + * @member {google.cloud.channel.v1.IChannelPartnerLink|null|undefined} channelPartnerLink + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @instance + */ + UpdateChannelPartnerLinkRequest.prototype.channelPartnerLink = null; + + /** + * UpdateChannelPartnerLinkRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @instance + */ + UpdateChannelPartnerLinkRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateChannelPartnerLinkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.UpdateChannelPartnerLinkRequest} UpdateChannelPartnerLinkRequest instance + */ + UpdateChannelPartnerLinkRequest.create = function create(properties) { + return new UpdateChannelPartnerLinkRequest(properties); + }; + + /** + * Encodes the specified UpdateChannelPartnerLinkRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest} message UpdateChannelPartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelPartnerLinkRequest.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.channelPartnerLink != null && Object.hasOwnProperty.call(message, "channelPartnerLink")) + $root.google.cloud.channel.v1.ChannelPartnerLink.encode(message.channelPartnerLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateChannelPartnerLinkRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest} message UpdateChannelPartnerLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelPartnerLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateChannelPartnerLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.UpdateChannelPartnerLinkRequest} UpdateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelPartnerLinkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.channelPartnerLink = $root.google.cloud.channel.v1.ChannelPartnerLink.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateChannelPartnerLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.UpdateChannelPartnerLinkRequest} UpdateChannelPartnerLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelPartnerLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateChannelPartnerLinkRequest message. + * @function verify + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateChannelPartnerLinkRequest.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.channelPartnerLink != null && message.hasOwnProperty("channelPartnerLink")) { + var error = $root.google.cloud.channel.v1.ChannelPartnerLink.verify(message.channelPartnerLink); + if (error) + return "channelPartnerLink." + 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 UpdateChannelPartnerLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.UpdateChannelPartnerLinkRequest} UpdateChannelPartnerLinkRequest + */ + UpdateChannelPartnerLinkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest) + return object; + var message = new $root.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.channelPartnerLink != null) { + if (typeof object.channelPartnerLink !== "object") + throw TypeError(".google.cloud.channel.v1.UpdateChannelPartnerLinkRequest.channelPartnerLink: object expected"); + message.channelPartnerLink = $root.google.cloud.channel.v1.ChannelPartnerLink.fromObject(object.channelPartnerLink); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.channel.v1.UpdateChannelPartnerLinkRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateChannelPartnerLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {google.cloud.channel.v1.UpdateChannelPartnerLinkRequest} message UpdateChannelPartnerLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateChannelPartnerLinkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.channelPartnerLink = null; + object.updateMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.channelPartnerLink != null && message.hasOwnProperty("channelPartnerLink")) + object.channelPartnerLink = $root.google.cloud.channel.v1.ChannelPartnerLink.toObject(message.channelPartnerLink, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateChannelPartnerLinkRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateChannelPartnerLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateChannelPartnerLinkRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.UpdateChannelPartnerLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelPartnerLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.UpdateChannelPartnerLinkRequest"; + }; + + return UpdateChannelPartnerLinkRequest; + })(); + + v1.GetCustomerRepricingConfigRequest = (function() { + + /** + * Properties of a GetCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface IGetCustomerRepricingConfigRequest + * @property {string|null} [name] GetCustomerRepricingConfigRequest name + */ + + /** + * Constructs a new GetCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a GetCustomerRepricingConfigRequest. + * @implements IGetCustomerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.IGetCustomerRepricingConfigRequest=} [properties] Properties to set + */ + function GetCustomerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCustomerRepricingConfigRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @instance + */ + GetCustomerRepricingConfigRequest.prototype.name = ""; + + /** + * Creates a new GetCustomerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IGetCustomerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.GetCustomerRepricingConfigRequest} GetCustomerRepricingConfigRequest instance + */ + GetCustomerRepricingConfigRequest.create = function create(properties) { + return new GetCustomerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified GetCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IGetCustomerRepricingConfigRequest} message GetCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomerRepricingConfigRequest.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 GetCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetCustomerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IGetCustomerRepricingConfigRequest} message GetCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCustomerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCustomerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.GetCustomerRepricingConfigRequest} GetCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.GetCustomerRepricingConfigRequest(); + 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 GetCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.GetCustomerRepricingConfigRequest} GetCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCustomerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCustomerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCustomerRepricingConfigRequest.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 GetCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.GetCustomerRepricingConfigRequest} GetCustomerRepricingConfigRequest + */ + GetCustomerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.GetCustomerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.GetCustomerRepricingConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.GetCustomerRepricingConfigRequest} message GetCustomerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCustomerRepricingConfigRequest.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 GetCustomerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetCustomerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCustomerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.GetCustomerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCustomerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.GetCustomerRepricingConfigRequest"; + }; + + return GetCustomerRepricingConfigRequest; + })(); + + v1.ListCustomerRepricingConfigsRequest = (function() { + + /** + * Properties of a ListCustomerRepricingConfigsRequest. + * @memberof google.cloud.channel.v1 + * @interface IListCustomerRepricingConfigsRequest + * @property {string|null} [parent] ListCustomerRepricingConfigsRequest parent + * @property {number|null} [pageSize] ListCustomerRepricingConfigsRequest pageSize + * @property {string|null} [pageToken] ListCustomerRepricingConfigsRequest pageToken + * @property {string|null} [filter] ListCustomerRepricingConfigsRequest filter + */ + + /** + * Constructs a new ListCustomerRepricingConfigsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListCustomerRepricingConfigsRequest. + * @implements IListCustomerRepricingConfigsRequest + * @constructor + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsRequest=} [properties] Properties to set + */ + function ListCustomerRepricingConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomerRepricingConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @instance + */ + ListCustomerRepricingConfigsRequest.prototype.parent = ""; + + /** + * ListCustomerRepricingConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @instance + */ + ListCustomerRepricingConfigsRequest.prototype.pageSize = 0; + + /** + * ListCustomerRepricingConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @instance + */ + ListCustomerRepricingConfigsRequest.prototype.pageToken = ""; + + /** + * ListCustomerRepricingConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @instance + */ + ListCustomerRepricingConfigsRequest.prototype.filter = ""; + + /** + * Creates a new ListCustomerRepricingConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsRequest} ListCustomerRepricingConfigsRequest instance + */ + ListCustomerRepricingConfigsRequest.create = function create(properties) { + return new ListCustomerRepricingConfigsRequest(properties); + }; + + /** + * Encodes the specified ListCustomerRepricingConfigsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsRequest} message ListCustomerRepricingConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomerRepricingConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListCustomerRepricingConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsRequest} message ListCustomerRepricingConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomerRepricingConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomerRepricingConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsRequest} ListCustomerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomerRepricingConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomerRepricingConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsRequest} ListCustomerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomerRepricingConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomerRepricingConfigsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomerRepricingConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListCustomerRepricingConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsRequest} ListCustomerRepricingConfigsRequest + */ + ListCustomerRepricingConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListCustomerRepricingConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.ListCustomerRepricingConfigsRequest} message ListCustomerRepricingConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomerRepricingConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListCustomerRepricingConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCustomerRepricingConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomerRepricingConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomerRepricingConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListCustomerRepricingConfigsRequest"; + }; + + return ListCustomerRepricingConfigsRequest; + })(); + + v1.ListCustomerRepricingConfigsResponse = (function() { + + /** + * Properties of a ListCustomerRepricingConfigsResponse. + * @memberof google.cloud.channel.v1 + * @interface IListCustomerRepricingConfigsResponse + * @property {Array.|null} [customerRepricingConfigs] ListCustomerRepricingConfigsResponse customerRepricingConfigs + * @property {string|null} [nextPageToken] ListCustomerRepricingConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListCustomerRepricingConfigsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListCustomerRepricingConfigsResponse. + * @implements IListCustomerRepricingConfigsResponse + * @constructor + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsResponse=} [properties] Properties to set + */ + function ListCustomerRepricingConfigsResponse(properties) { + this.customerRepricingConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCustomerRepricingConfigsResponse customerRepricingConfigs. + * @member {Array.} customerRepricingConfigs + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @instance + */ + ListCustomerRepricingConfigsResponse.prototype.customerRepricingConfigs = $util.emptyArray; + + /** + * ListCustomerRepricingConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @instance + */ + ListCustomerRepricingConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCustomerRepricingConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsResponse} ListCustomerRepricingConfigsResponse instance + */ + ListCustomerRepricingConfigsResponse.create = function create(properties) { + return new ListCustomerRepricingConfigsResponse(properties); + }; + + /** + * Encodes the specified ListCustomerRepricingConfigsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsResponse} message ListCustomerRepricingConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomerRepricingConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerRepricingConfigs != null && message.customerRepricingConfigs.length) + for (var i = 0; i < message.customerRepricingConfigs.length; ++i) + $root.google.cloud.channel.v1.CustomerRepricingConfig.encode(message.customerRepricingConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListCustomerRepricingConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.IListCustomerRepricingConfigsResponse} message ListCustomerRepricingConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCustomerRepricingConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCustomerRepricingConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsResponse} ListCustomerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomerRepricingConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListCustomerRepricingConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.customerRepricingConfigs && message.customerRepricingConfigs.length)) + message.customerRepricingConfigs = []; + message.customerRepricingConfigs.push($root.google.cloud.channel.v1.CustomerRepricingConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCustomerRepricingConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsResponse} ListCustomerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCustomerRepricingConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCustomerRepricingConfigsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCustomerRepricingConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customerRepricingConfigs != null && message.hasOwnProperty("customerRepricingConfigs")) { + if (!Array.isArray(message.customerRepricingConfigs)) + return "customerRepricingConfigs: array expected"; + for (var i = 0; i < message.customerRepricingConfigs.length; ++i) { + var error = $root.google.cloud.channel.v1.CustomerRepricingConfig.verify(message.customerRepricingConfigs[i]); + if (error) + return "customerRepricingConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCustomerRepricingConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListCustomerRepricingConfigsResponse} ListCustomerRepricingConfigsResponse + */ + ListCustomerRepricingConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListCustomerRepricingConfigsResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListCustomerRepricingConfigsResponse(); + if (object.customerRepricingConfigs) { + if (!Array.isArray(object.customerRepricingConfigs)) + throw TypeError(".google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.customerRepricingConfigs: array expected"); + message.customerRepricingConfigs = []; + for (var i = 0; i < object.customerRepricingConfigs.length; ++i) { + if (typeof object.customerRepricingConfigs[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.customerRepricingConfigs: object expected"); + message.customerRepricingConfigs[i] = $root.google.cloud.channel.v1.CustomerRepricingConfig.fromObject(object.customerRepricingConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCustomerRepricingConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.ListCustomerRepricingConfigsResponse} message ListCustomerRepricingConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCustomerRepricingConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customerRepricingConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.customerRepricingConfigs && message.customerRepricingConfigs.length) { + object.customerRepricingConfigs = []; + for (var j = 0; j < message.customerRepricingConfigs.length; ++j) + object.customerRepricingConfigs[j] = $root.google.cloud.channel.v1.CustomerRepricingConfig.toObject(message.customerRepricingConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCustomerRepricingConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCustomerRepricingConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCustomerRepricingConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListCustomerRepricingConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCustomerRepricingConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListCustomerRepricingConfigsResponse"; + }; + + return ListCustomerRepricingConfigsResponse; + })(); + + v1.CreateCustomerRepricingConfigRequest = (function() { + + /** + * Properties of a CreateCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface ICreateCustomerRepricingConfigRequest + * @property {string|null} [parent] CreateCustomerRepricingConfigRequest parent + * @property {google.cloud.channel.v1.ICustomerRepricingConfig|null} [customerRepricingConfig] CreateCustomerRepricingConfigRequest customerRepricingConfig + */ + + /** + * Constructs a new CreateCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CreateCustomerRepricingConfigRequest. + * @implements ICreateCustomerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest=} [properties] Properties to set + */ + function CreateCustomerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomerRepricingConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @instance + */ + CreateCustomerRepricingConfigRequest.prototype.parent = ""; + + /** + * CreateCustomerRepricingConfigRequest customerRepricingConfig. + * @member {google.cloud.channel.v1.ICustomerRepricingConfig|null|undefined} customerRepricingConfig + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @instance + */ + CreateCustomerRepricingConfigRequest.prototype.customerRepricingConfig = null; + + /** + * Creates a new CreateCustomerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CreateCustomerRepricingConfigRequest} CreateCustomerRepricingConfigRequest instance + */ + CreateCustomerRepricingConfigRequest.create = function create(properties) { + return new CreateCustomerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified CreateCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest} message CreateCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomerRepricingConfigRequest.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.customerRepricingConfig != null && Object.hasOwnProperty.call(message, "customerRepricingConfig")) + $root.google.cloud.channel.v1.CustomerRepricingConfig.encode(message.customerRepricingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateCustomerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest} message CreateCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CreateCustomerRepricingConfigRequest} CreateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customerRepricingConfig = $root.google.cloud.channel.v1.CustomerRepricingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CreateCustomerRepricingConfigRequest} CreateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomerRepricingConfigRequest.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.customerRepricingConfig != null && message.hasOwnProperty("customerRepricingConfig")) { + var error = $root.google.cloud.channel.v1.CustomerRepricingConfig.verify(message.customerRepricingConfig); + if (error) + return "customerRepricingConfig." + error; + } + return null; + }; + + /** + * Creates a CreateCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CreateCustomerRepricingConfigRequest} CreateCustomerRepricingConfigRequest + */ + CreateCustomerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customerRepricingConfig != null) { + if (typeof object.customerRepricingConfig !== "object") + throw TypeError(".google.cloud.channel.v1.CreateCustomerRepricingConfigRequest.customerRepricingConfig: object expected"); + message.customerRepricingConfig = $root.google.cloud.channel.v1.CustomerRepricingConfig.fromObject(object.customerRepricingConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.CreateCustomerRepricingConfigRequest} message CreateCustomerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomerRepricingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customerRepricingConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customerRepricingConfig != null && message.hasOwnProperty("customerRepricingConfig")) + object.customerRepricingConfig = $root.google.cloud.channel.v1.CustomerRepricingConfig.toObject(message.customerRepricingConfig, options); + return object; + }; + + /** + * Converts this CreateCustomerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CreateCustomerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CreateCustomerRepricingConfigRequest"; + }; + + return CreateCustomerRepricingConfigRequest; + })(); + + v1.UpdateCustomerRepricingConfigRequest = (function() { + + /** + * Properties of an UpdateCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface IUpdateCustomerRepricingConfigRequest + * @property {google.cloud.channel.v1.ICustomerRepricingConfig|null} [customerRepricingConfig] UpdateCustomerRepricingConfigRequest customerRepricingConfig + */ + + /** + * Constructs a new UpdateCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an UpdateCustomerRepricingConfigRequest. + * @implements IUpdateCustomerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest=} [properties] Properties to set + */ + function UpdateCustomerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomerRepricingConfigRequest customerRepricingConfig. + * @member {google.cloud.channel.v1.ICustomerRepricingConfig|null|undefined} customerRepricingConfig + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @instance + */ + UpdateCustomerRepricingConfigRequest.prototype.customerRepricingConfig = null; + + /** + * Creates a new UpdateCustomerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest} UpdateCustomerRepricingConfigRequest instance + */ + UpdateCustomerRepricingConfigRequest.create = function create(properties) { + return new UpdateCustomerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest} message UpdateCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomerRepricingConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerRepricingConfig != null && Object.hasOwnProperty.call(message, "customerRepricingConfig")) + $root.google.cloud.channel.v1.CustomerRepricingConfig.encode(message.customerRepricingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest} message UpdateCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest} UpdateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customerRepricingConfig = $root.google.cloud.channel.v1.CustomerRepricingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest} UpdateCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomerRepricingConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customerRepricingConfig != null && message.hasOwnProperty("customerRepricingConfig")) { + var error = $root.google.cloud.channel.v1.CustomerRepricingConfig.verify(message.customerRepricingConfig); + if (error) + return "customerRepricingConfig." + error; + } + return null; + }; + + /** + * Creates an UpdateCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest} UpdateCustomerRepricingConfigRequest + */ + UpdateCustomerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest(); + if (object.customerRepricingConfig != null) { + if (typeof object.customerRepricingConfig !== "object") + throw TypeError(".google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest.customerRepricingConfig: object expected"); + message.customerRepricingConfig = $root.google.cloud.channel.v1.CustomerRepricingConfig.fromObject(object.customerRepricingConfig); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest} message UpdateCustomerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomerRepricingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customerRepricingConfig = null; + if (message.customerRepricingConfig != null && message.hasOwnProperty("customerRepricingConfig")) + object.customerRepricingConfig = $root.google.cloud.channel.v1.CustomerRepricingConfig.toObject(message.customerRepricingConfig, options); + return object; + }; + + /** + * Converts this UpdateCustomerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest"; + }; + + return UpdateCustomerRepricingConfigRequest; + })(); + + v1.DeleteCustomerRepricingConfigRequest = (function() { + + /** + * Properties of a DeleteCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface IDeleteCustomerRepricingConfigRequest + * @property {string|null} [name] DeleteCustomerRepricingConfigRequest name + */ + + /** + * Constructs a new DeleteCustomerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a DeleteCustomerRepricingConfigRequest. + * @implements IDeleteCustomerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest=} [properties] Properties to set + */ + function DeleteCustomerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomerRepricingConfigRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @instance + */ + DeleteCustomerRepricingConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteCustomerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest} DeleteCustomerRepricingConfigRequest instance + */ + DeleteCustomerRepricingConfigRequest.create = function create(properties) { + return new DeleteCustomerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest} message DeleteCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomerRepricingConfigRequest.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 DeleteCustomerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest} message DeleteCustomerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest} DeleteCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest(); + 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 DeleteCustomerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest} DeleteCustomerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomerRepricingConfigRequest.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 DeleteCustomerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest} DeleteCustomerRepricingConfigRequest + */ + DeleteCustomerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest} message DeleteCustomerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomerRepricingConfigRequest.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 DeleteCustomerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest"; + }; + + return DeleteCustomerRepricingConfigRequest; + })(); + + v1.GetChannelPartnerRepricingConfigRequest = (function() { + + /** + * Properties of a GetChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface IGetChannelPartnerRepricingConfigRequest + * @property {string|null} [name] GetChannelPartnerRepricingConfigRequest name + */ + + /** + * Constructs a new GetChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a GetChannelPartnerRepricingConfigRequest. + * @implements IGetChannelPartnerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest=} [properties] Properties to set + */ + function GetChannelPartnerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChannelPartnerRepricingConfigRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @instance + */ + GetChannelPartnerRepricingConfigRequest.prototype.name = ""; + + /** + * Creates a new GetChannelPartnerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest} GetChannelPartnerRepricingConfigRequest instance + */ + GetChannelPartnerRepricingConfigRequest.create = function create(properties) { + return new GetChannelPartnerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified GetChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest} message GetChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChannelPartnerRepricingConfigRequest.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 GetChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest} message GetChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChannelPartnerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest} GetChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChannelPartnerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest(); + 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 GetChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest} GetChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChannelPartnerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChannelPartnerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChannelPartnerRepricingConfigRequest.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 GetChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest} GetChannelPartnerRepricingConfigRequest + */ + GetChannelPartnerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest} message GetChannelPartnerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChannelPartnerRepricingConfigRequest.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 GetChannelPartnerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetChannelPartnerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChannelPartnerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChannelPartnerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest"; + }; + + return GetChannelPartnerRepricingConfigRequest; + })(); + + v1.ListChannelPartnerRepricingConfigsRequest = (function() { + + /** + * Properties of a ListChannelPartnerRepricingConfigsRequest. + * @memberof google.cloud.channel.v1 + * @interface IListChannelPartnerRepricingConfigsRequest + * @property {string|null} [parent] ListChannelPartnerRepricingConfigsRequest parent + * @property {number|null} [pageSize] ListChannelPartnerRepricingConfigsRequest pageSize + * @property {string|null} [pageToken] ListChannelPartnerRepricingConfigsRequest pageToken + * @property {string|null} [filter] ListChannelPartnerRepricingConfigsRequest filter + */ + + /** + * Constructs a new ListChannelPartnerRepricingConfigsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListChannelPartnerRepricingConfigsRequest. + * @implements IListChannelPartnerRepricingConfigsRequest + * @constructor + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest=} [properties] Properties to set + */ + function ListChannelPartnerRepricingConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelPartnerRepricingConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @instance + */ + ListChannelPartnerRepricingConfigsRequest.prototype.parent = ""; + + /** + * ListChannelPartnerRepricingConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @instance + */ + ListChannelPartnerRepricingConfigsRequest.prototype.pageSize = 0; + + /** + * ListChannelPartnerRepricingConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @instance + */ + ListChannelPartnerRepricingConfigsRequest.prototype.pageToken = ""; + + /** + * ListChannelPartnerRepricingConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @instance + */ + ListChannelPartnerRepricingConfigsRequest.prototype.filter = ""; + + /** + * Creates a new ListChannelPartnerRepricingConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest} ListChannelPartnerRepricingConfigsRequest instance + */ + ListChannelPartnerRepricingConfigsRequest.create = function create(properties) { + return new ListChannelPartnerRepricingConfigsRequest(properties); + }; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest} message ListChannelPartnerRepricingConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerRepricingConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest} message ListChannelPartnerRepricingConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerRepricingConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelPartnerRepricingConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest} ListChannelPartnerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerRepricingConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelPartnerRepricingConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest} ListChannelPartnerRepricingConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerRepricingConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelPartnerRepricingConfigsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelPartnerRepricingConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListChannelPartnerRepricingConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest} ListChannelPartnerRepricingConfigsRequest + */ + ListChannelPartnerRepricingConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListChannelPartnerRepricingConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest} message ListChannelPartnerRepricingConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelPartnerRepricingConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListChannelPartnerRepricingConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChannelPartnerRepricingConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelPartnerRepricingConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelPartnerRepricingConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest"; + }; + + return ListChannelPartnerRepricingConfigsRequest; + })(); + + v1.ListChannelPartnerRepricingConfigsResponse = (function() { + + /** + * Properties of a ListChannelPartnerRepricingConfigsResponse. + * @memberof google.cloud.channel.v1 + * @interface IListChannelPartnerRepricingConfigsResponse + * @property {Array.|null} [channelPartnerRepricingConfigs] ListChannelPartnerRepricingConfigsResponse channelPartnerRepricingConfigs + * @property {string|null} [nextPageToken] ListChannelPartnerRepricingConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListChannelPartnerRepricingConfigsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListChannelPartnerRepricingConfigsResponse. + * @implements IListChannelPartnerRepricingConfigsResponse + * @constructor + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse=} [properties] Properties to set + */ + function ListChannelPartnerRepricingConfigsResponse(properties) { + this.channelPartnerRepricingConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelPartnerRepricingConfigsResponse channelPartnerRepricingConfigs. + * @member {Array.} channelPartnerRepricingConfigs + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @instance + */ + ListChannelPartnerRepricingConfigsResponse.prototype.channelPartnerRepricingConfigs = $util.emptyArray; + + /** + * ListChannelPartnerRepricingConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @instance + */ + ListChannelPartnerRepricingConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChannelPartnerRepricingConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse} ListChannelPartnerRepricingConfigsResponse instance + */ + ListChannelPartnerRepricingConfigsResponse.create = function create(properties) { + return new ListChannelPartnerRepricingConfigsResponse(properties); + }; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse} message ListChannelPartnerRepricingConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerRepricingConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelPartnerRepricingConfigs != null && message.channelPartnerRepricingConfigs.length) + for (var i = 0; i < message.channelPartnerRepricingConfigs.length; ++i) + $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.encode(message.channelPartnerRepricingConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListChannelPartnerRepricingConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse} message ListChannelPartnerRepricingConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelPartnerRepricingConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelPartnerRepricingConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse} ListChannelPartnerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerRepricingConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.channelPartnerRepricingConfigs && message.channelPartnerRepricingConfigs.length)) + message.channelPartnerRepricingConfigs = []; + message.channelPartnerRepricingConfigs.push($root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelPartnerRepricingConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse} ListChannelPartnerRepricingConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelPartnerRepricingConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelPartnerRepricingConfigsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelPartnerRepricingConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelPartnerRepricingConfigs != null && message.hasOwnProperty("channelPartnerRepricingConfigs")) { + if (!Array.isArray(message.channelPartnerRepricingConfigs)) + return "channelPartnerRepricingConfigs: array expected"; + for (var i = 0; i < message.channelPartnerRepricingConfigs.length; ++i) { + var error = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify(message.channelPartnerRepricingConfigs[i]); + if (error) + return "channelPartnerRepricingConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChannelPartnerRepricingConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse} ListChannelPartnerRepricingConfigsResponse + */ + ListChannelPartnerRepricingConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse(); + if (object.channelPartnerRepricingConfigs) { + if (!Array.isArray(object.channelPartnerRepricingConfigs)) + throw TypeError(".google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.channelPartnerRepricingConfigs: array expected"); + message.channelPartnerRepricingConfigs = []; + for (var i = 0; i < object.channelPartnerRepricingConfigs.length; ++i) { + if (typeof object.channelPartnerRepricingConfigs[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.channelPartnerRepricingConfigs: object expected"); + message.channelPartnerRepricingConfigs[i] = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.fromObject(object.channelPartnerRepricingConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChannelPartnerRepricingConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse} message ListChannelPartnerRepricingConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelPartnerRepricingConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.channelPartnerRepricingConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.channelPartnerRepricingConfigs && message.channelPartnerRepricingConfigs.length) { + object.channelPartnerRepricingConfigs = []; + for (var j = 0; j < message.channelPartnerRepricingConfigs.length; ++j) + object.channelPartnerRepricingConfigs[j] = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.toObject(message.channelPartnerRepricingConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChannelPartnerRepricingConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChannelPartnerRepricingConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelPartnerRepricingConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelPartnerRepricingConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse"; + }; + + return ListChannelPartnerRepricingConfigsResponse; + })(); + + v1.CreateChannelPartnerRepricingConfigRequest = (function() { + + /** + * Properties of a CreateChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface ICreateChannelPartnerRepricingConfigRequest + * @property {string|null} [parent] CreateChannelPartnerRepricingConfigRequest parent + * @property {google.cloud.channel.v1.IChannelPartnerRepricingConfig|null} [channelPartnerRepricingConfig] CreateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig + */ + + /** + * Constructs a new CreateChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CreateChannelPartnerRepricingConfigRequest. + * @implements ICreateChannelPartnerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest=} [properties] Properties to set + */ + function CreateChannelPartnerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateChannelPartnerRepricingConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @instance + */ + CreateChannelPartnerRepricingConfigRequest.prototype.parent = ""; + + /** + * CreateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig. + * @member {google.cloud.channel.v1.IChannelPartnerRepricingConfig|null|undefined} channelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @instance + */ + CreateChannelPartnerRepricingConfigRequest.prototype.channelPartnerRepricingConfig = null; + + /** + * Creates a new CreateChannelPartnerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest} CreateChannelPartnerRepricingConfigRequest instance + */ + CreateChannelPartnerRepricingConfigRequest.create = function create(properties) { + return new CreateChannelPartnerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified CreateChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest} message CreateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelPartnerRepricingConfigRequest.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.channelPartnerRepricingConfig != null && Object.hasOwnProperty.call(message, "channelPartnerRepricingConfig")) + $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.encode(message.channelPartnerRepricingConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest} message CreateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChannelPartnerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest} CreateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChannelPartnerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.channelPartnerRepricingConfig = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest} CreateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChannelPartnerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateChannelPartnerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateChannelPartnerRepricingConfigRequest.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.channelPartnerRepricingConfig != null && message.hasOwnProperty("channelPartnerRepricingConfig")) { + var error = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify(message.channelPartnerRepricingConfig); + if (error) + return "channelPartnerRepricingConfig." + error; + } + return null; + }; + + /** + * Creates a CreateChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest} CreateChannelPartnerRepricingConfigRequest + */ + CreateChannelPartnerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.channelPartnerRepricingConfig != null) { + if (typeof object.channelPartnerRepricingConfig !== "object") + throw TypeError(".google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest.channelPartnerRepricingConfig: object expected"); + message.channelPartnerRepricingConfig = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.fromObject(object.channelPartnerRepricingConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest} message CreateChannelPartnerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateChannelPartnerRepricingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.channelPartnerRepricingConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.channelPartnerRepricingConfig != null && message.hasOwnProperty("channelPartnerRepricingConfig")) + object.channelPartnerRepricingConfig = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.toObject(message.channelPartnerRepricingConfig, options); + return object; + }; + + /** + * Converts this CreateChannelPartnerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateChannelPartnerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateChannelPartnerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateChannelPartnerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest"; + }; + + return CreateChannelPartnerRepricingConfigRequest; + })(); + + v1.UpdateChannelPartnerRepricingConfigRequest = (function() { + + /** + * Properties of an UpdateChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface IUpdateChannelPartnerRepricingConfigRequest + * @property {google.cloud.channel.v1.IChannelPartnerRepricingConfig|null} [channelPartnerRepricingConfig] UpdateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig + */ + + /** + * Constructs a new UpdateChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an UpdateChannelPartnerRepricingConfigRequest. + * @implements IUpdateChannelPartnerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest=} [properties] Properties to set + */ + function UpdateChannelPartnerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateChannelPartnerRepricingConfigRequest channelPartnerRepricingConfig. + * @member {google.cloud.channel.v1.IChannelPartnerRepricingConfig|null|undefined} channelPartnerRepricingConfig + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @instance + */ + UpdateChannelPartnerRepricingConfigRequest.prototype.channelPartnerRepricingConfig = null; + + /** + * Creates a new UpdateChannelPartnerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest} UpdateChannelPartnerRepricingConfigRequest instance + */ + UpdateChannelPartnerRepricingConfigRequest.create = function create(properties) { + return new UpdateChannelPartnerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest} message UpdateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelPartnerRepricingConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelPartnerRepricingConfig != null && Object.hasOwnProperty.call(message, "channelPartnerRepricingConfig")) + $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.encode(message.channelPartnerRepricingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest} message UpdateChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelPartnerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest} UpdateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelPartnerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.channelPartnerRepricingConfig = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest} UpdateChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelPartnerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateChannelPartnerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateChannelPartnerRepricingConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelPartnerRepricingConfig != null && message.hasOwnProperty("channelPartnerRepricingConfig")) { + var error = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.verify(message.channelPartnerRepricingConfig); + if (error) + return "channelPartnerRepricingConfig." + error; + } + return null; + }; + + /** + * Creates an UpdateChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest} UpdateChannelPartnerRepricingConfigRequest + */ + UpdateChannelPartnerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest(); + if (object.channelPartnerRepricingConfig != null) { + if (typeof object.channelPartnerRepricingConfig !== "object") + throw TypeError(".google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest.channelPartnerRepricingConfig: object expected"); + message.channelPartnerRepricingConfig = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.fromObject(object.channelPartnerRepricingConfig); + } + return message; + }; + + /** + * Creates a plain object from an UpdateChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest} message UpdateChannelPartnerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateChannelPartnerRepricingConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.channelPartnerRepricingConfig = null; + if (message.channelPartnerRepricingConfig != null && message.hasOwnProperty("channelPartnerRepricingConfig")) + object.channelPartnerRepricingConfig = $root.google.cloud.channel.v1.ChannelPartnerRepricingConfig.toObject(message.channelPartnerRepricingConfig, options); + return object; + }; + + /** + * Converts this UpdateChannelPartnerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateChannelPartnerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateChannelPartnerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelPartnerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest"; + }; + + return UpdateChannelPartnerRepricingConfigRequest; + })(); + + v1.DeleteChannelPartnerRepricingConfigRequest = (function() { + + /** + * Properties of a DeleteChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @interface IDeleteChannelPartnerRepricingConfigRequest + * @property {string|null} [name] DeleteChannelPartnerRepricingConfigRequest name + */ + + /** + * Constructs a new DeleteChannelPartnerRepricingConfigRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a DeleteChannelPartnerRepricingConfigRequest. + * @implements IDeleteChannelPartnerRepricingConfigRequest + * @constructor + * @param {google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest=} [properties] Properties to set + */ + function DeleteChannelPartnerRepricingConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteChannelPartnerRepricingConfigRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @instance + */ + DeleteChannelPartnerRepricingConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteChannelPartnerRepricingConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest} DeleteChannelPartnerRepricingConfigRequest instance + */ + DeleteChannelPartnerRepricingConfigRequest.create = function create(properties) { + return new DeleteChannelPartnerRepricingConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteChannelPartnerRepricingConfigRequest message. Does not implicitly {@link google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest} message DeleteChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteChannelPartnerRepricingConfigRequest.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 DeleteChannelPartnerRepricingConfigRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest} message DeleteChannelPartnerRepricingConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteChannelPartnerRepricingConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteChannelPartnerRepricingConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest} DeleteChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteChannelPartnerRepricingConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest(); + 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 DeleteChannelPartnerRepricingConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest} DeleteChannelPartnerRepricingConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteChannelPartnerRepricingConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteChannelPartnerRepricingConfigRequest message. + * @function verify + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteChannelPartnerRepricingConfigRequest.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 DeleteChannelPartnerRepricingConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest} DeleteChannelPartnerRepricingConfigRequest + */ + DeleteChannelPartnerRepricingConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest) + return object; + var message = new $root.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteChannelPartnerRepricingConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest} message DeleteChannelPartnerRepricingConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteChannelPartnerRepricingConfigRequest.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 DeleteChannelPartnerRepricingConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteChannelPartnerRepricingConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteChannelPartnerRepricingConfigRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteChannelPartnerRepricingConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest"; + }; + + return DeleteChannelPartnerRepricingConfigRequest; + })(); + + v1.CreateEntitlementRequest = (function() { + + /** + * Properties of a CreateEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @interface ICreateEntitlementRequest + * @property {string|null} [parent] CreateEntitlementRequest parent + * @property {google.cloud.channel.v1.IEntitlement|null} [entitlement] CreateEntitlementRequest entitlement + * @property {string|null} [requestId] CreateEntitlementRequest requestId + */ + + /** + * Constructs a new CreateEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CreateEntitlementRequest. + * @implements ICreateEntitlementRequest + * @constructor + * @param {google.cloud.channel.v1.ICreateEntitlementRequest=} [properties] Properties to set + */ + function CreateEntitlementRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEntitlementRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @instance + */ + CreateEntitlementRequest.prototype.parent = ""; + + /** + * CreateEntitlementRequest entitlement. + * @member {google.cloud.channel.v1.IEntitlement|null|undefined} entitlement + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @instance + */ + CreateEntitlementRequest.prototype.entitlement = null; + + /** + * CreateEntitlementRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @instance + */ + CreateEntitlementRequest.prototype.requestId = ""; + + /** + * Creates a new CreateEntitlementRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ICreateEntitlementRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CreateEntitlementRequest} CreateEntitlementRequest instance + */ + CreateEntitlementRequest.create = function create(properties) { + return new CreateEntitlementRequest(properties); + }; + + /** + * Encodes the specified CreateEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.CreateEntitlementRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ICreateEntitlementRequest} message CreateEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntitlementRequest.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.entitlement != null && Object.hasOwnProperty.call(message, "entitlement")) + $root.google.cloud.channel.v1.Entitlement.encode(message.entitlement, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CreateEntitlementRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ICreateEntitlementRequest} message CreateEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntitlementRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEntitlementRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CreateEntitlementRequest} CreateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntitlementRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CreateEntitlementRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.entitlement = $root.google.cloud.channel.v1.Entitlement.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEntitlementRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CreateEntitlementRequest} CreateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntitlementRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEntitlementRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntitlementRequest.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.entitlement != null && message.hasOwnProperty("entitlement")) { + var error = $root.google.cloud.channel.v1.Entitlement.verify(message.entitlement); + if (error) + return "entitlement." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CreateEntitlementRequest} CreateEntitlementRequest + */ + CreateEntitlementRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CreateEntitlementRequest) + return object; + var message = new $root.google.cloud.channel.v1.CreateEntitlementRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entitlement != null) { + if (typeof object.entitlement !== "object") + throw TypeError(".google.cloud.channel.v1.CreateEntitlementRequest.entitlement: object expected"); + message.entitlement = $root.google.cloud.channel.v1.Entitlement.fromObject(object.entitlement); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateEntitlementRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.CreateEntitlementRequest} message CreateEntitlementRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntitlementRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.entitlement = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + object.entitlement = $root.google.cloud.channel.v1.Entitlement.toObject(message.entitlement, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateEntitlementRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEntitlementRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEntitlementRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CreateEntitlementRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEntitlementRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CreateEntitlementRequest"; + }; + + return CreateEntitlementRequest; + })(); + + v1.TransferEntitlementsRequest = (function() { + + /** + * Properties of a TransferEntitlementsRequest. + * @memberof google.cloud.channel.v1 + * @interface ITransferEntitlementsRequest + * @property {string|null} [parent] TransferEntitlementsRequest parent + * @property {Array.|null} [entitlements] TransferEntitlementsRequest entitlements + * @property {string|null} [authToken] TransferEntitlementsRequest authToken + * @property {string|null} [requestId] TransferEntitlementsRequest requestId + */ + + /** + * Constructs a new TransferEntitlementsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TransferEntitlementsRequest. + * @implements ITransferEntitlementsRequest + * @constructor + * @param {google.cloud.channel.v1.ITransferEntitlementsRequest=} [properties] Properties to set + */ + function TransferEntitlementsRequest(properties) { + this.entitlements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferEntitlementsRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @instance + */ + TransferEntitlementsRequest.prototype.parent = ""; + + /** + * TransferEntitlementsRequest entitlements. + * @member {Array.} entitlements + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @instance + */ + TransferEntitlementsRequest.prototype.entitlements = $util.emptyArray; + + /** + * TransferEntitlementsRequest authToken. + * @member {string} authToken + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @instance + */ + TransferEntitlementsRequest.prototype.authToken = ""; + + /** + * TransferEntitlementsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @instance + */ + TransferEntitlementsRequest.prototype.requestId = ""; + + /** + * Creates a new TransferEntitlementsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TransferEntitlementsRequest} TransferEntitlementsRequest instance + */ + TransferEntitlementsRequest.create = function create(properties) { + return new TransferEntitlementsRequest(properties); + }; + + /** + * Encodes the specified TransferEntitlementsRequest message. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsRequest} message TransferEntitlementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEntitlementsRequest.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.entitlements != null && message.entitlements.length) + for (var i = 0; i < message.entitlements.length; ++i) + $root.google.cloud.channel.v1.Entitlement.encode(message.entitlements[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.authToken != null && Object.hasOwnProperty.call(message, "authToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authToken); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified TransferEntitlementsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsRequest} message TransferEntitlementsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEntitlementsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferEntitlementsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TransferEntitlementsRequest} TransferEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEntitlementsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TransferEntitlementsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.entitlements && message.entitlements.length)) + message.entitlements = []; + message.entitlements.push($root.google.cloud.channel.v1.Entitlement.decode(reader, reader.uint32())); + break; + } + case 4: { + message.authToken = reader.string(); + break; + } + case 6: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferEntitlementsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TransferEntitlementsRequest} TransferEntitlementsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEntitlementsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferEntitlementsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferEntitlementsRequest.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.entitlements != null && message.hasOwnProperty("entitlements")) { + if (!Array.isArray(message.entitlements)) + return "entitlements: array expected"; + for (var i = 0; i < message.entitlements.length; ++i) { + var error = $root.google.cloud.channel.v1.Entitlement.verify(message.entitlements[i]); + if (error) + return "entitlements." + error; + } + } + if (message.authToken != null && message.hasOwnProperty("authToken")) + if (!$util.isString(message.authToken)) + return "authToken: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a TransferEntitlementsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TransferEntitlementsRequest} TransferEntitlementsRequest + */ + TransferEntitlementsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TransferEntitlementsRequest) + return object; + var message = new $root.google.cloud.channel.v1.TransferEntitlementsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entitlements) { + if (!Array.isArray(object.entitlements)) + throw TypeError(".google.cloud.channel.v1.TransferEntitlementsRequest.entitlements: array expected"); + message.entitlements = []; + for (var i = 0; i < object.entitlements.length; ++i) { + if (typeof object.entitlements[i] !== "object") + throw TypeError(".google.cloud.channel.v1.TransferEntitlementsRequest.entitlements: object expected"); + message.entitlements[i] = $root.google.cloud.channel.v1.Entitlement.fromObject(object.entitlements[i]); + } + } + if (object.authToken != null) + message.authToken = String(object.authToken); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a TransferEntitlementsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {google.cloud.channel.v1.TransferEntitlementsRequest} message TransferEntitlementsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferEntitlementsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entitlements = []; + if (options.defaults) { + object.parent = ""; + object.authToken = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entitlements && message.entitlements.length) { + object.entitlements = []; + for (var j = 0; j < message.entitlements.length; ++j) + object.entitlements[j] = $root.google.cloud.channel.v1.Entitlement.toObject(message.entitlements[j], options); + } + if (message.authToken != null && message.hasOwnProperty("authToken")) + object.authToken = message.authToken; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this TransferEntitlementsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @instance + * @returns {Object.} JSON object + */ + TransferEntitlementsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferEntitlementsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TransferEntitlementsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferEntitlementsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TransferEntitlementsRequest"; + }; + + return TransferEntitlementsRequest; + })(); + + v1.TransferEntitlementsResponse = (function() { + + /** + * Properties of a TransferEntitlementsResponse. + * @memberof google.cloud.channel.v1 + * @interface ITransferEntitlementsResponse + * @property {Array.|null} [entitlements] TransferEntitlementsResponse entitlements + */ + + /** + * Constructs a new TransferEntitlementsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TransferEntitlementsResponse. + * @implements ITransferEntitlementsResponse + * @constructor + * @param {google.cloud.channel.v1.ITransferEntitlementsResponse=} [properties] Properties to set + */ + function TransferEntitlementsResponse(properties) { + this.entitlements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferEntitlementsResponse entitlements. + * @member {Array.} entitlements + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @instance + */ + TransferEntitlementsResponse.prototype.entitlements = $util.emptyArray; + + /** + * Creates a new TransferEntitlementsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TransferEntitlementsResponse} TransferEntitlementsResponse instance + */ + TransferEntitlementsResponse.create = function create(properties) { + return new TransferEntitlementsResponse(properties); + }; + + /** + * Encodes the specified TransferEntitlementsResponse message. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsResponse} message TransferEntitlementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEntitlementsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlements != null && message.entitlements.length) + for (var i = 0; i < message.entitlements.length; ++i) + $root.google.cloud.channel.v1.Entitlement.encode(message.entitlements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferEntitlementsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsResponse} message TransferEntitlementsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEntitlementsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferEntitlementsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TransferEntitlementsResponse} TransferEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEntitlementsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TransferEntitlementsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entitlements && message.entitlements.length)) + message.entitlements = []; + message.entitlements.push($root.google.cloud.channel.v1.Entitlement.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferEntitlementsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TransferEntitlementsResponse} TransferEntitlementsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEntitlementsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferEntitlementsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferEntitlementsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlements != null && message.hasOwnProperty("entitlements")) { + if (!Array.isArray(message.entitlements)) + return "entitlements: array expected"; + for (var i = 0; i < message.entitlements.length; ++i) { + var error = $root.google.cloud.channel.v1.Entitlement.verify(message.entitlements[i]); + if (error) + return "entitlements." + error; + } + } + return null; + }; + + /** + * Creates a TransferEntitlementsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TransferEntitlementsResponse} TransferEntitlementsResponse + */ + TransferEntitlementsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TransferEntitlementsResponse) + return object; + var message = new $root.google.cloud.channel.v1.TransferEntitlementsResponse(); + if (object.entitlements) { + if (!Array.isArray(object.entitlements)) + throw TypeError(".google.cloud.channel.v1.TransferEntitlementsResponse.entitlements: array expected"); + message.entitlements = []; + for (var i = 0; i < object.entitlements.length; ++i) { + if (typeof object.entitlements[i] !== "object") + throw TypeError(".google.cloud.channel.v1.TransferEntitlementsResponse.entitlements: object expected"); + message.entitlements[i] = $root.google.cloud.channel.v1.Entitlement.fromObject(object.entitlements[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TransferEntitlementsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {google.cloud.channel.v1.TransferEntitlementsResponse} message TransferEntitlementsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferEntitlementsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entitlements = []; + if (message.entitlements && message.entitlements.length) { + object.entitlements = []; + for (var j = 0; j < message.entitlements.length; ++j) + object.entitlements[j] = $root.google.cloud.channel.v1.Entitlement.toObject(message.entitlements[j], options); + } + return object; + }; + + /** + * Converts this TransferEntitlementsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @instance + * @returns {Object.} JSON object + */ + TransferEntitlementsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferEntitlementsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TransferEntitlementsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferEntitlementsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TransferEntitlementsResponse"; + }; + + return TransferEntitlementsResponse; + })(); + + v1.TransferEntitlementsToGoogleRequest = (function() { + + /** + * Properties of a TransferEntitlementsToGoogleRequest. + * @memberof google.cloud.channel.v1 + * @interface ITransferEntitlementsToGoogleRequest + * @property {string|null} [parent] TransferEntitlementsToGoogleRequest parent + * @property {Array.|null} [entitlements] TransferEntitlementsToGoogleRequest entitlements + * @property {string|null} [requestId] TransferEntitlementsToGoogleRequest requestId + */ + + /** + * Constructs a new TransferEntitlementsToGoogleRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a TransferEntitlementsToGoogleRequest. + * @implements ITransferEntitlementsToGoogleRequest + * @constructor + * @param {google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest=} [properties] Properties to set + */ + function TransferEntitlementsToGoogleRequest(properties) { + this.entitlements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferEntitlementsToGoogleRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @instance + */ + TransferEntitlementsToGoogleRequest.prototype.parent = ""; + + /** + * TransferEntitlementsToGoogleRequest entitlements. + * @member {Array.} entitlements + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @instance + */ + TransferEntitlementsToGoogleRequest.prototype.entitlements = $util.emptyArray; + + /** + * TransferEntitlementsToGoogleRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @instance + */ + TransferEntitlementsToGoogleRequest.prototype.requestId = ""; + + /** + * Creates a new TransferEntitlementsToGoogleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.TransferEntitlementsToGoogleRequest} TransferEntitlementsToGoogleRequest instance + */ + TransferEntitlementsToGoogleRequest.create = function create(properties) { + return new TransferEntitlementsToGoogleRequest(properties); + }; + + /** + * Encodes the specified TransferEntitlementsToGoogleRequest message. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsToGoogleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest} message TransferEntitlementsToGoogleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEntitlementsToGoogleRequest.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.entitlements != null && message.entitlements.length) + for (var i = 0; i < message.entitlements.length; ++i) + $root.google.cloud.channel.v1.Entitlement.encode(message.entitlements[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified TransferEntitlementsToGoogleRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.TransferEntitlementsToGoogleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest} message TransferEntitlementsToGoogleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferEntitlementsToGoogleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferEntitlementsToGoogleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.TransferEntitlementsToGoogleRequest} TransferEntitlementsToGoogleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEntitlementsToGoogleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.entitlements && message.entitlements.length)) + message.entitlements = []; + message.entitlements.push($root.google.cloud.channel.v1.Entitlement.decode(reader, reader.uint32())); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferEntitlementsToGoogleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.TransferEntitlementsToGoogleRequest} TransferEntitlementsToGoogleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferEntitlementsToGoogleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferEntitlementsToGoogleRequest message. + * @function verify + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferEntitlementsToGoogleRequest.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.entitlements != null && message.hasOwnProperty("entitlements")) { + if (!Array.isArray(message.entitlements)) + return "entitlements: array expected"; + for (var i = 0; i < message.entitlements.length; ++i) { + var error = $root.google.cloud.channel.v1.Entitlement.verify(message.entitlements[i]); + if (error) + return "entitlements." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a TransferEntitlementsToGoogleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.TransferEntitlementsToGoogleRequest} TransferEntitlementsToGoogleRequest + */ + TransferEntitlementsToGoogleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest) + return object; + var message = new $root.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entitlements) { + if (!Array.isArray(object.entitlements)) + throw TypeError(".google.cloud.channel.v1.TransferEntitlementsToGoogleRequest.entitlements: array expected"); + message.entitlements = []; + for (var i = 0; i < object.entitlements.length; ++i) { + if (typeof object.entitlements[i] !== "object") + throw TypeError(".google.cloud.channel.v1.TransferEntitlementsToGoogleRequest.entitlements: object expected"); + message.entitlements[i] = $root.google.cloud.channel.v1.Entitlement.fromObject(object.entitlements[i]); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a TransferEntitlementsToGoogleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {google.cloud.channel.v1.TransferEntitlementsToGoogleRequest} message TransferEntitlementsToGoogleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferEntitlementsToGoogleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entitlements = []; + if (options.defaults) { + object.parent = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entitlements && message.entitlements.length) { + object.entitlements = []; + for (var j = 0; j < message.entitlements.length; ++j) + object.entitlements[j] = $root.google.cloud.channel.v1.Entitlement.toObject(message.entitlements[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this TransferEntitlementsToGoogleRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @instance + * @returns {Object.} JSON object + */ + TransferEntitlementsToGoogleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferEntitlementsToGoogleRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.TransferEntitlementsToGoogleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferEntitlementsToGoogleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.TransferEntitlementsToGoogleRequest"; + }; + + return TransferEntitlementsToGoogleRequest; + })(); + + v1.ChangeParametersRequest = (function() { + + /** + * Properties of a ChangeParametersRequest. + * @memberof google.cloud.channel.v1 + * @interface IChangeParametersRequest + * @property {string|null} [name] ChangeParametersRequest name + * @property {Array.|null} [parameters] ChangeParametersRequest parameters + * @property {string|null} [requestId] ChangeParametersRequest requestId + * @property {string|null} [purchaseOrderId] ChangeParametersRequest purchaseOrderId + */ + + /** + * Constructs a new ChangeParametersRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ChangeParametersRequest. + * @implements IChangeParametersRequest + * @constructor + * @param {google.cloud.channel.v1.IChangeParametersRequest=} [properties] Properties to set + */ + function ChangeParametersRequest(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeParametersRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @instance + */ + ChangeParametersRequest.prototype.name = ""; + + /** + * ChangeParametersRequest parameters. + * @member {Array.} parameters + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @instance + */ + ChangeParametersRequest.prototype.parameters = $util.emptyArray; + + /** + * ChangeParametersRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @instance + */ + ChangeParametersRequest.prototype.requestId = ""; + + /** + * ChangeParametersRequest purchaseOrderId. + * @member {string} purchaseOrderId + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @instance + */ + ChangeParametersRequest.prototype.purchaseOrderId = ""; + + /** + * Creates a new ChangeParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {google.cloud.channel.v1.IChangeParametersRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ChangeParametersRequest} ChangeParametersRequest instance + */ + ChangeParametersRequest.create = function create(properties) { + return new ChangeParametersRequest(properties); + }; + + /** + * Encodes the specified ChangeParametersRequest message. Does not implicitly {@link google.cloud.channel.v1.ChangeParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {google.cloud.channel.v1.IChangeParametersRequest} message ChangeParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeParametersRequest.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.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.channel.v1.Parameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.purchaseOrderId != null && Object.hasOwnProperty.call(message, "purchaseOrderId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.purchaseOrderId); + return writer; + }; + + /** + * Encodes the specified ChangeParametersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChangeParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {google.cloud.channel.v1.IChangeParametersRequest} message ChangeParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ChangeParametersRequest} ChangeParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeParametersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ChangeParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.channel.v1.Parameter.decode(reader, reader.uint32())); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.purchaseOrderId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ChangeParametersRequest} ChangeParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeParametersRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeParametersRequest.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.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.channel.v1.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.purchaseOrderId != null && message.hasOwnProperty("purchaseOrderId")) + if (!$util.isString(message.purchaseOrderId)) + return "purchaseOrderId: string expected"; + return null; + }; + + /** + * Creates a ChangeParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ChangeParametersRequest} ChangeParametersRequest + */ + ChangeParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ChangeParametersRequest) + return object; + var message = new $root.google.cloud.channel.v1.ChangeParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.channel.v1.ChangeParametersRequest.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ChangeParametersRequest.parameters: object expected"); + message.parameters[i] = $root.google.cloud.channel.v1.Parameter.fromObject(object.parameters[i]); + } + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.purchaseOrderId != null) + message.purchaseOrderId = String(object.purchaseOrderId); + return message; + }; + + /** + * Creates a plain object from a ChangeParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {google.cloud.channel.v1.ChangeParametersRequest} message ChangeParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.purchaseOrderId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.channel.v1.Parameter.toObject(message.parameters[j], options); + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.purchaseOrderId != null && message.hasOwnProperty("purchaseOrderId")) + object.purchaseOrderId = message.purchaseOrderId; + return object; + }; + + /** + * Converts this ChangeParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @instance + * @returns {Object.} JSON object + */ + ChangeParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeParametersRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ChangeParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ChangeParametersRequest"; + }; + + return ChangeParametersRequest; + })(); + + v1.ChangeRenewalSettingsRequest = (function() { + + /** + * Properties of a ChangeRenewalSettingsRequest. + * @memberof google.cloud.channel.v1 + * @interface IChangeRenewalSettingsRequest + * @property {string|null} [name] ChangeRenewalSettingsRequest name + * @property {google.cloud.channel.v1.IRenewalSettings|null} [renewalSettings] ChangeRenewalSettingsRequest renewalSettings + * @property {string|null} [requestId] ChangeRenewalSettingsRequest requestId + */ + + /** + * Constructs a new ChangeRenewalSettingsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ChangeRenewalSettingsRequest. + * @implements IChangeRenewalSettingsRequest + * @constructor + * @param {google.cloud.channel.v1.IChangeRenewalSettingsRequest=} [properties] Properties to set + */ + function ChangeRenewalSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeRenewalSettingsRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @instance + */ + ChangeRenewalSettingsRequest.prototype.name = ""; + + /** + * ChangeRenewalSettingsRequest renewalSettings. + * @member {google.cloud.channel.v1.IRenewalSettings|null|undefined} renewalSettings + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @instance + */ + ChangeRenewalSettingsRequest.prototype.renewalSettings = null; + + /** + * ChangeRenewalSettingsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @instance + */ + ChangeRenewalSettingsRequest.prototype.requestId = ""; + + /** + * Creates a new ChangeRenewalSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {google.cloud.channel.v1.IChangeRenewalSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ChangeRenewalSettingsRequest} ChangeRenewalSettingsRequest instance + */ + ChangeRenewalSettingsRequest.create = function create(properties) { + return new ChangeRenewalSettingsRequest(properties); + }; + + /** + * Encodes the specified ChangeRenewalSettingsRequest message. Does not implicitly {@link google.cloud.channel.v1.ChangeRenewalSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {google.cloud.channel.v1.IChangeRenewalSettingsRequest} message ChangeRenewalSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeRenewalSettingsRequest.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.renewalSettings != null && Object.hasOwnProperty.call(message, "renewalSettings")) + $root.google.cloud.channel.v1.RenewalSettings.encode(message.renewalSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ChangeRenewalSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChangeRenewalSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {google.cloud.channel.v1.IChangeRenewalSettingsRequest} message ChangeRenewalSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeRenewalSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeRenewalSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ChangeRenewalSettingsRequest} ChangeRenewalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeRenewalSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ChangeRenewalSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.renewalSettings = $root.google.cloud.channel.v1.RenewalSettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeRenewalSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ChangeRenewalSettingsRequest} ChangeRenewalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeRenewalSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeRenewalSettingsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeRenewalSettingsRequest.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.renewalSettings != null && message.hasOwnProperty("renewalSettings")) { + var error = $root.google.cloud.channel.v1.RenewalSettings.verify(message.renewalSettings); + if (error) + return "renewalSettings." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ChangeRenewalSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ChangeRenewalSettingsRequest} ChangeRenewalSettingsRequest + */ + ChangeRenewalSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ChangeRenewalSettingsRequest) + return object; + var message = new $root.google.cloud.channel.v1.ChangeRenewalSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.renewalSettings != null) { + if (typeof object.renewalSettings !== "object") + throw TypeError(".google.cloud.channel.v1.ChangeRenewalSettingsRequest.renewalSettings: object expected"); + message.renewalSettings = $root.google.cloud.channel.v1.RenewalSettings.fromObject(object.renewalSettings); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ChangeRenewalSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {google.cloud.channel.v1.ChangeRenewalSettingsRequest} message ChangeRenewalSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeRenewalSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.renewalSettings = null; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.renewalSettings != null && message.hasOwnProperty("renewalSettings")) + object.renewalSettings = $root.google.cloud.channel.v1.RenewalSettings.toObject(message.renewalSettings, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ChangeRenewalSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + ChangeRenewalSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeRenewalSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ChangeRenewalSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeRenewalSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ChangeRenewalSettingsRequest"; + }; + + return ChangeRenewalSettingsRequest; + })(); + + v1.ChangeOfferRequest = (function() { + + /** + * Properties of a ChangeOfferRequest. + * @memberof google.cloud.channel.v1 + * @interface IChangeOfferRequest + * @property {string|null} [name] ChangeOfferRequest name + * @property {string|null} [offer] ChangeOfferRequest offer + * @property {Array.|null} [parameters] ChangeOfferRequest parameters + * @property {string|null} [purchaseOrderId] ChangeOfferRequest purchaseOrderId + * @property {string|null} [requestId] ChangeOfferRequest requestId + */ + + /** + * Constructs a new ChangeOfferRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ChangeOfferRequest. + * @implements IChangeOfferRequest + * @constructor + * @param {google.cloud.channel.v1.IChangeOfferRequest=} [properties] Properties to set + */ + function ChangeOfferRequest(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeOfferRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + */ + ChangeOfferRequest.prototype.name = ""; + + /** + * ChangeOfferRequest offer. + * @member {string} offer + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + */ + ChangeOfferRequest.prototype.offer = ""; + + /** + * ChangeOfferRequest parameters. + * @member {Array.} parameters + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + */ + ChangeOfferRequest.prototype.parameters = $util.emptyArray; + + /** + * ChangeOfferRequest purchaseOrderId. + * @member {string} purchaseOrderId + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + */ + ChangeOfferRequest.prototype.purchaseOrderId = ""; + + /** + * ChangeOfferRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + */ + ChangeOfferRequest.prototype.requestId = ""; + + /** + * Creates a new ChangeOfferRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {google.cloud.channel.v1.IChangeOfferRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ChangeOfferRequest} ChangeOfferRequest instance + */ + ChangeOfferRequest.create = function create(properties) { + return new ChangeOfferRequest(properties); + }; + + /** + * Encodes the specified ChangeOfferRequest message. Does not implicitly {@link google.cloud.channel.v1.ChangeOfferRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {google.cloud.channel.v1.IChangeOfferRequest} message ChangeOfferRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeOfferRequest.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.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.offer); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.channel.v1.Parameter.encode(message.parameters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.purchaseOrderId != null && Object.hasOwnProperty.call(message, "purchaseOrderId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.purchaseOrderId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ChangeOfferRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ChangeOfferRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {google.cloud.channel.v1.IChangeOfferRequest} message ChangeOfferRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeOfferRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeOfferRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ChangeOfferRequest} ChangeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeOfferRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ChangeOfferRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.offer = reader.string(); + break; + } + case 3: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.channel.v1.Parameter.decode(reader, reader.uint32())); + break; + } + case 5: { + message.purchaseOrderId = reader.string(); + break; + } + case 6: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeOfferRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ChangeOfferRequest} ChangeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeOfferRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeOfferRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeOfferRequest.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.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.channel.v1.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.purchaseOrderId != null && message.hasOwnProperty("purchaseOrderId")) + if (!$util.isString(message.purchaseOrderId)) + return "purchaseOrderId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ChangeOfferRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ChangeOfferRequest} ChangeOfferRequest + */ + ChangeOfferRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ChangeOfferRequest) + return object; + var message = new $root.google.cloud.channel.v1.ChangeOfferRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.offer != null) + message.offer = String(object.offer); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.channel.v1.ChangeOfferRequest.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ChangeOfferRequest.parameters: object expected"); + message.parameters[i] = $root.google.cloud.channel.v1.Parameter.fromObject(object.parameters[i]); + } + } + if (object.purchaseOrderId != null) + message.purchaseOrderId = String(object.purchaseOrderId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ChangeOfferRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {google.cloud.channel.v1.ChangeOfferRequest} message ChangeOfferRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeOfferRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) { + object.name = ""; + object.offer = ""; + object.purchaseOrderId = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.channel.v1.Parameter.toObject(message.parameters[j], options); + } + if (message.purchaseOrderId != null && message.hasOwnProperty("purchaseOrderId")) + object.purchaseOrderId = message.purchaseOrderId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ChangeOfferRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + * @returns {Object.} JSON object + */ + ChangeOfferRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeOfferRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeOfferRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ChangeOfferRequest"; + }; + + return ChangeOfferRequest; + })(); + + v1.StartPaidServiceRequest = (function() { + + /** + * Properties of a StartPaidServiceRequest. + * @memberof google.cloud.channel.v1 + * @interface IStartPaidServiceRequest + * @property {string|null} [name] StartPaidServiceRequest name + * @property {string|null} [requestId] StartPaidServiceRequest requestId + */ + + /** + * Constructs a new StartPaidServiceRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a StartPaidServiceRequest. + * @implements IStartPaidServiceRequest + * @constructor + * @param {google.cloud.channel.v1.IStartPaidServiceRequest=} [properties] Properties to set + */ + function StartPaidServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartPaidServiceRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @instance + */ + StartPaidServiceRequest.prototype.name = ""; + + /** + * StartPaidServiceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @instance + */ + StartPaidServiceRequest.prototype.requestId = ""; + + /** + * Creates a new StartPaidServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {google.cloud.channel.v1.IStartPaidServiceRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.StartPaidServiceRequest} StartPaidServiceRequest instance + */ + StartPaidServiceRequest.create = function create(properties) { + return new StartPaidServiceRequest(properties); + }; + + /** + * Encodes the specified StartPaidServiceRequest message. Does not implicitly {@link google.cloud.channel.v1.StartPaidServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {google.cloud.channel.v1.IStartPaidServiceRequest} message StartPaidServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartPaidServiceRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified StartPaidServiceRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.StartPaidServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {google.cloud.channel.v1.IStartPaidServiceRequest} message StartPaidServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartPaidServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartPaidServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.StartPaidServiceRequest} StartPaidServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartPaidServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.StartPaidServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartPaidServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.StartPaidServiceRequest} StartPaidServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartPaidServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartPaidServiceRequest message. + * @function verify + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartPaidServiceRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a StartPaidServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.StartPaidServiceRequest} StartPaidServiceRequest + */ + StartPaidServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.StartPaidServiceRequest) + return object; + var message = new $root.google.cloud.channel.v1.StartPaidServiceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a StartPaidServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {google.cloud.channel.v1.StartPaidServiceRequest} message StartPaidServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartPaidServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this StartPaidServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @instance + * @returns {Object.} JSON object + */ + StartPaidServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartPaidServiceRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.StartPaidServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartPaidServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.StartPaidServiceRequest"; + }; + + return StartPaidServiceRequest; + })(); + + v1.CancelEntitlementRequest = (function() { + + /** + * Properties of a CancelEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @interface ICancelEntitlementRequest + * @property {string|null} [name] CancelEntitlementRequest name + * @property {string|null} [requestId] CancelEntitlementRequest requestId + */ + + /** + * Constructs a new CancelEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CancelEntitlementRequest. + * @implements ICancelEntitlementRequest + * @constructor + * @param {google.cloud.channel.v1.ICancelEntitlementRequest=} [properties] Properties to set + */ + function CancelEntitlementRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelEntitlementRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @instance + */ + CancelEntitlementRequest.prototype.name = ""; + + /** + * CancelEntitlementRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @instance + */ + CancelEntitlementRequest.prototype.requestId = ""; + + /** + * Creates a new CancelEntitlementRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ICancelEntitlementRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CancelEntitlementRequest} CancelEntitlementRequest instance + */ + CancelEntitlementRequest.create = function create(properties) { + return new CancelEntitlementRequest(properties); + }; + + /** + * Encodes the specified CancelEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.CancelEntitlementRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ICancelEntitlementRequest} message CancelEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelEntitlementRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CancelEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CancelEntitlementRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ICancelEntitlementRequest} message CancelEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelEntitlementRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelEntitlementRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CancelEntitlementRequest} CancelEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelEntitlementRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CancelEntitlementRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelEntitlementRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CancelEntitlementRequest} CancelEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelEntitlementRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelEntitlementRequest message. + * @function verify + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelEntitlementRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CancelEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CancelEntitlementRequest} CancelEntitlementRequest + */ + CancelEntitlementRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CancelEntitlementRequest) + return object; + var message = new $root.google.cloud.channel.v1.CancelEntitlementRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CancelEntitlementRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {google.cloud.channel.v1.CancelEntitlementRequest} message CancelEntitlementRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelEntitlementRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CancelEntitlementRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @instance + * @returns {Object.} JSON object + */ + CancelEntitlementRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelEntitlementRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CancelEntitlementRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelEntitlementRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CancelEntitlementRequest"; + }; + + return CancelEntitlementRequest; + })(); + + v1.SuspendEntitlementRequest = (function() { + + /** + * Properties of a SuspendEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @interface ISuspendEntitlementRequest + * @property {string|null} [name] SuspendEntitlementRequest name + * @property {string|null} [requestId] SuspendEntitlementRequest requestId + */ + + /** + * Constructs a new SuspendEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a SuspendEntitlementRequest. + * @implements ISuspendEntitlementRequest + * @constructor + * @param {google.cloud.channel.v1.ISuspendEntitlementRequest=} [properties] Properties to set + */ + function SuspendEntitlementRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuspendEntitlementRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @instance + */ + SuspendEntitlementRequest.prototype.name = ""; + + /** + * SuspendEntitlementRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @instance + */ + SuspendEntitlementRequest.prototype.requestId = ""; + + /** + * Creates a new SuspendEntitlementRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ISuspendEntitlementRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.SuspendEntitlementRequest} SuspendEntitlementRequest instance + */ + SuspendEntitlementRequest.create = function create(properties) { + return new SuspendEntitlementRequest(properties); + }; + + /** + * Encodes the specified SuspendEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.SuspendEntitlementRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ISuspendEntitlementRequest} message SuspendEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuspendEntitlementRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified SuspendEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SuspendEntitlementRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ISuspendEntitlementRequest} message SuspendEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuspendEntitlementRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuspendEntitlementRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.SuspendEntitlementRequest} SuspendEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuspendEntitlementRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.SuspendEntitlementRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuspendEntitlementRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.SuspendEntitlementRequest} SuspendEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuspendEntitlementRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuspendEntitlementRequest message. + * @function verify + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuspendEntitlementRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a SuspendEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.SuspendEntitlementRequest} SuspendEntitlementRequest + */ + SuspendEntitlementRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.SuspendEntitlementRequest) + return object; + var message = new $root.google.cloud.channel.v1.SuspendEntitlementRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SuspendEntitlementRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {google.cloud.channel.v1.SuspendEntitlementRequest} message SuspendEntitlementRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuspendEntitlementRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this SuspendEntitlementRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @instance + * @returns {Object.} JSON object + */ + SuspendEntitlementRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SuspendEntitlementRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.SuspendEntitlementRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SuspendEntitlementRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.SuspendEntitlementRequest"; + }; + + return SuspendEntitlementRequest; + })(); + + v1.ActivateEntitlementRequest = (function() { + + /** + * Properties of an ActivateEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @interface IActivateEntitlementRequest + * @property {string|null} [name] ActivateEntitlementRequest name + * @property {string|null} [requestId] ActivateEntitlementRequest requestId + */ + + /** + * Constructs a new ActivateEntitlementRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an ActivateEntitlementRequest. + * @implements IActivateEntitlementRequest + * @constructor + * @param {google.cloud.channel.v1.IActivateEntitlementRequest=} [properties] Properties to set + */ + function ActivateEntitlementRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActivateEntitlementRequest name. + * @member {string} name + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @instance + */ + ActivateEntitlementRequest.prototype.name = ""; + + /** + * ActivateEntitlementRequest requestId. + * @member {string} requestId + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @instance + */ + ActivateEntitlementRequest.prototype.requestId = ""; + + /** + * Creates a new ActivateEntitlementRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.IActivateEntitlementRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ActivateEntitlementRequest} ActivateEntitlementRequest instance + */ + ActivateEntitlementRequest.create = function create(properties) { + return new ActivateEntitlementRequest(properties); + }; + + /** + * Encodes the specified ActivateEntitlementRequest message. Does not implicitly {@link google.cloud.channel.v1.ActivateEntitlementRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.IActivateEntitlementRequest} message ActivateEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateEntitlementRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ActivateEntitlementRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ActivateEntitlementRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.IActivateEntitlementRequest} message ActivateEntitlementRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActivateEntitlementRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActivateEntitlementRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ActivateEntitlementRequest} ActivateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateEntitlementRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ActivateEntitlementRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActivateEntitlementRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ActivateEntitlementRequest} ActivateEntitlementRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActivateEntitlementRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActivateEntitlementRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActivateEntitlementRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an ActivateEntitlementRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ActivateEntitlementRequest} ActivateEntitlementRequest + */ + ActivateEntitlementRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ActivateEntitlementRequest) + return object; + var message = new $root.google.cloud.channel.v1.ActivateEntitlementRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an ActivateEntitlementRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {google.cloud.channel.v1.ActivateEntitlementRequest} message ActivateEntitlementRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActivateEntitlementRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ActivateEntitlementRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @instance + * @returns {Object.} JSON object + */ + ActivateEntitlementRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActivateEntitlementRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ActivateEntitlementRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActivateEntitlementRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ActivateEntitlementRequest"; + }; + + return ActivateEntitlementRequest; + })(); + + v1.LookupOfferRequest = (function() { + + /** + * Properties of a LookupOfferRequest. + * @memberof google.cloud.channel.v1 + * @interface ILookupOfferRequest + * @property {string|null} [entitlement] LookupOfferRequest entitlement + */ + + /** + * Constructs a new LookupOfferRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a LookupOfferRequest. + * @implements ILookupOfferRequest + * @constructor + * @param {google.cloud.channel.v1.ILookupOfferRequest=} [properties] Properties to set + */ + function LookupOfferRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LookupOfferRequest entitlement. + * @member {string} entitlement + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @instance + */ + LookupOfferRequest.prototype.entitlement = ""; + + /** + * Creates a new LookupOfferRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {google.cloud.channel.v1.ILookupOfferRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.LookupOfferRequest} LookupOfferRequest instance + */ + LookupOfferRequest.create = function create(properties) { + return new LookupOfferRequest(properties); + }; + + /** + * Encodes the specified LookupOfferRequest message. Does not implicitly {@link google.cloud.channel.v1.LookupOfferRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {google.cloud.channel.v1.ILookupOfferRequest} message LookupOfferRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupOfferRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlement != null && Object.hasOwnProperty.call(message, "entitlement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entitlement); + return writer; + }; + + /** + * Encodes the specified LookupOfferRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.LookupOfferRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {google.cloud.channel.v1.ILookupOfferRequest} message LookupOfferRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupOfferRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupOfferRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.LookupOfferRequest} LookupOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupOfferRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.LookupOfferRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entitlement = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupOfferRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.LookupOfferRequest} LookupOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupOfferRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupOfferRequest message. + * @function verify + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupOfferRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + if (!$util.isString(message.entitlement)) + return "entitlement: string expected"; + return null; + }; + + /** + * Creates a LookupOfferRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.LookupOfferRequest} LookupOfferRequest + */ + LookupOfferRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.LookupOfferRequest) + return object; + var message = new $root.google.cloud.channel.v1.LookupOfferRequest(); + if (object.entitlement != null) + message.entitlement = String(object.entitlement); + return message; + }; + + /** + * Creates a plain object from a LookupOfferRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {google.cloud.channel.v1.LookupOfferRequest} message LookupOfferRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupOfferRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.entitlement = ""; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + object.entitlement = message.entitlement; + return object; + }; + + /** + * Converts this LookupOfferRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @instance + * @returns {Object.} JSON object + */ + LookupOfferRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LookupOfferRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.LookupOfferRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LookupOfferRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.LookupOfferRequest"; + }; + + return LookupOfferRequest; + })(); + + v1.ListProductsRequest = (function() { + + /** + * Properties of a ListProductsRequest. + * @memberof google.cloud.channel.v1 + * @interface IListProductsRequest + * @property {string|null} [account] ListProductsRequest account + * @property {number|null} [pageSize] ListProductsRequest pageSize + * @property {string|null} [pageToken] ListProductsRequest pageToken + * @property {string|null} [languageCode] ListProductsRequest languageCode + */ + + /** + * Constructs a new ListProductsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListProductsRequest. + * @implements IListProductsRequest + * @constructor + * @param {google.cloud.channel.v1.IListProductsRequest=} [properties] Properties to set + */ + function ListProductsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProductsRequest account. + * @member {string} account + * @memberof google.cloud.channel.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.account = ""; + + /** + * ListProductsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageSize = 0; + + /** + * ListProductsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.pageToken = ""; + + /** + * ListProductsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListProductsRequest + * @instance + */ + ListProductsRequest.prototype.languageCode = ""; + + /** + * Creates a new ListProductsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {google.cloud.channel.v1.IListProductsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListProductsRequest} ListProductsRequest instance + */ + ListProductsRequest.create = function create(properties) { + return new ListProductsRequest(properties); + }; + + /** + * Encodes the specified ListProductsRequest message. Does not implicitly {@link google.cloud.channel.v1.ListProductsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {google.cloud.channel.v1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.account); + 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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListProductsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListProductsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {google.cloud.channel.v1.IListProductsRequest} message ListProductsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListProductsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.account = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListProductsRequest} ListProductsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.account != null && message.hasOwnProperty("account")) + if (!$util.isString(message.account)) + return "account: 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListProductsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListProductsRequest} ListProductsRequest + */ + ListProductsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListProductsRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListProductsRequest(); + if (object.account != null) + message.account = String(object.account); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListProductsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {google.cloud.channel.v1.ListProductsRequest} message ListProductsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.account = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = message.account; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListProductsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListProductsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProductsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProductsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListProductsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProductsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListProductsRequest"; + }; + + return ListProductsRequest; + })(); + + v1.ListProductsResponse = (function() { + + /** + * Properties of a ListProductsResponse. + * @memberof google.cloud.channel.v1 + * @interface IListProductsResponse + * @property {Array.|null} [products] ListProductsResponse products + * @property {string|null} [nextPageToken] ListProductsResponse nextPageToken + */ + + /** + * Constructs a new ListProductsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListProductsResponse. + * @implements IListProductsResponse + * @constructor + * @param {google.cloud.channel.v1.IListProductsResponse=} [properties] Properties to set + */ + function ListProductsResponse(properties) { + this.products = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProductsResponse products. + * @member {Array.} products + * @memberof google.cloud.channel.v1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.products = $util.emptyArray; + + /** + * ListProductsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListProductsResponse + * @instance + */ + ListProductsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProductsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {google.cloud.channel.v1.IListProductsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListProductsResponse} ListProductsResponse instance + */ + ListProductsResponse.create = function create(properties) { + return new ListProductsResponse(properties); + }; + + /** + * Encodes the specified ListProductsResponse message. Does not implicitly {@link google.cloud.channel.v1.ListProductsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {google.cloud.channel.v1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.google.cloud.channel.v1.Product.encode(message.products[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListProductsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListProductsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {google.cloud.channel.v1.IListProductsResponse} message ListProductsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProductsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListProductsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.google.cloud.channel.v1.Product.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProductsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListProductsResponse} ListProductsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProductsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProductsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProductsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.google.cloud.channel.v1.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProductsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListProductsResponse} ListProductsResponse + */ + ListProductsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListProductsResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListProductsResponse(); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".google.cloud.channel.v1.ListProductsResponse.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListProductsResponse.products: object expected"); + message.products[i] = $root.google.cloud.channel.v1.Product.fromObject(object.products[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProductsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {google.cloud.channel.v1.ListProductsResponse} message ListProductsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProductsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.google.cloud.channel.v1.Product.toObject(message.products[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProductsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListProductsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProductsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProductsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListProductsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProductsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListProductsResponse"; + }; + + return ListProductsResponse; + })(); + + v1.ListSkusRequest = (function() { + + /** + * Properties of a ListSkusRequest. + * @memberof google.cloud.channel.v1 + * @interface IListSkusRequest + * @property {string|null} [parent] ListSkusRequest parent + * @property {string|null} [account] ListSkusRequest account + * @property {number|null} [pageSize] ListSkusRequest pageSize + * @property {string|null} [pageToken] ListSkusRequest pageToken + * @property {string|null} [languageCode] ListSkusRequest languageCode + */ + + /** + * Constructs a new ListSkusRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListSkusRequest. + * @implements IListSkusRequest + * @constructor + * @param {google.cloud.channel.v1.IListSkusRequest=} [properties] Properties to set + */ + function ListSkusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSkusRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListSkusRequest + * @instance + */ + ListSkusRequest.prototype.parent = ""; + + /** + * ListSkusRequest account. + * @member {string} account + * @memberof google.cloud.channel.v1.ListSkusRequest + * @instance + */ + ListSkusRequest.prototype.account = ""; + + /** + * ListSkusRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListSkusRequest + * @instance + */ + ListSkusRequest.prototype.pageSize = 0; + + /** + * ListSkusRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListSkusRequest + * @instance + */ + ListSkusRequest.prototype.pageToken = ""; + + /** + * ListSkusRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListSkusRequest + * @instance + */ + ListSkusRequest.prototype.languageCode = ""; + + /** + * Creates a new ListSkusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {google.cloud.channel.v1.IListSkusRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListSkusRequest} ListSkusRequest instance + */ + ListSkusRequest.create = function create(properties) { + return new ListSkusRequest(properties); + }; + + /** + * Encodes the specified ListSkusRequest message. Does not implicitly {@link google.cloud.channel.v1.ListSkusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {google.cloud.channel.v1.IListSkusRequest} message ListSkusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSkusRequest.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.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.account); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListSkusRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSkusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {google.cloud.channel.v1.IListSkusRequest} message ListSkusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSkusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSkusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListSkusRequest} ListSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSkusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListSkusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.account = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSkusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListSkusRequest} ListSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSkusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSkusRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSkusRequest.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.account != null && message.hasOwnProperty("account")) + if (!$util.isString(message.account)) + return "account: 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListSkusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListSkusRequest} ListSkusRequest + */ + ListSkusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListSkusRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListSkusRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.account != null) + message.account = String(object.account); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListSkusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {google.cloud.channel.v1.ListSkusRequest} message ListSkusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSkusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.account = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.account != null && message.hasOwnProperty("account")) + object.account = message.account; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListSkusRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListSkusRequest + * @instance + * @returns {Object.} JSON object + */ + ListSkusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSkusRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListSkusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSkusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListSkusRequest"; + }; + + return ListSkusRequest; + })(); + + v1.ListSkusResponse = (function() { + + /** + * Properties of a ListSkusResponse. + * @memberof google.cloud.channel.v1 + * @interface IListSkusResponse + * @property {Array.|null} [skus] ListSkusResponse skus + * @property {string|null} [nextPageToken] ListSkusResponse nextPageToken + */ + + /** + * Constructs a new ListSkusResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListSkusResponse. + * @implements IListSkusResponse + * @constructor + * @param {google.cloud.channel.v1.IListSkusResponse=} [properties] Properties to set + */ + function ListSkusResponse(properties) { + this.skus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSkusResponse skus. + * @member {Array.} skus + * @memberof google.cloud.channel.v1.ListSkusResponse + * @instance + */ + ListSkusResponse.prototype.skus = $util.emptyArray; + + /** + * ListSkusResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListSkusResponse + * @instance + */ + ListSkusResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSkusResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {google.cloud.channel.v1.IListSkusResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListSkusResponse} ListSkusResponse instance + */ + ListSkusResponse.create = function create(properties) { + return new ListSkusResponse(properties); + }; + + /** + * Encodes the specified ListSkusResponse message. Does not implicitly {@link google.cloud.channel.v1.ListSkusResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {google.cloud.channel.v1.IListSkusResponse} message ListSkusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSkusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skus != null && message.skus.length) + for (var i = 0; i < message.skus.length; ++i) + $root.google.cloud.channel.v1.Sku.encode(message.skus[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSkusResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSkusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {google.cloud.channel.v1.IListSkusResponse} message ListSkusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSkusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSkusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListSkusResponse} ListSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSkusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListSkusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.skus && message.skus.length)) + message.skus = []; + message.skus.push($root.google.cloud.channel.v1.Sku.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSkusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListSkusResponse} ListSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSkusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSkusResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSkusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.skus != null && message.hasOwnProperty("skus")) { + if (!Array.isArray(message.skus)) + return "skus: array expected"; + for (var i = 0; i < message.skus.length; ++i) { + var error = $root.google.cloud.channel.v1.Sku.verify(message.skus[i]); + if (error) + return "skus." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSkusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListSkusResponse} ListSkusResponse + */ + ListSkusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListSkusResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListSkusResponse(); + if (object.skus) { + if (!Array.isArray(object.skus)) + throw TypeError(".google.cloud.channel.v1.ListSkusResponse.skus: array expected"); + message.skus = []; + for (var i = 0; i < object.skus.length; ++i) { + if (typeof object.skus[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListSkusResponse.skus: object expected"); + message.skus[i] = $root.google.cloud.channel.v1.Sku.fromObject(object.skus[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSkusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {google.cloud.channel.v1.ListSkusResponse} message ListSkusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSkusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.skus = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.skus && message.skus.length) { + object.skus = []; + for (var j = 0; j < message.skus.length; ++j) + object.skus[j] = $root.google.cloud.channel.v1.Sku.toObject(message.skus[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSkusResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListSkusResponse + * @instance + * @returns {Object.} JSON object + */ + ListSkusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSkusResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListSkusResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSkusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListSkusResponse"; + }; + + return ListSkusResponse; + })(); + + v1.ListOffersRequest = (function() { + + /** + * Properties of a ListOffersRequest. + * @memberof google.cloud.channel.v1 + * @interface IListOffersRequest + * @property {string|null} [parent] ListOffersRequest parent + * @property {number|null} [pageSize] ListOffersRequest pageSize + * @property {string|null} [pageToken] ListOffersRequest pageToken + * @property {string|null} [filter] ListOffersRequest filter + * @property {string|null} [languageCode] ListOffersRequest languageCode + */ + + /** + * Constructs a new ListOffersRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListOffersRequest. + * @implements IListOffersRequest + * @constructor + * @param {google.cloud.channel.v1.IListOffersRequest=} [properties] Properties to set + */ + function ListOffersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOffersRequest parent. + * @member {string} parent + * @memberof google.cloud.channel.v1.ListOffersRequest + * @instance + */ + ListOffersRequest.prototype.parent = ""; + + /** + * ListOffersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListOffersRequest + * @instance + */ + ListOffersRequest.prototype.pageSize = 0; + + /** + * ListOffersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListOffersRequest + * @instance + */ + ListOffersRequest.prototype.pageToken = ""; + + /** + * ListOffersRequest filter. + * @member {string} filter + * @memberof google.cloud.channel.v1.ListOffersRequest + * @instance + */ + ListOffersRequest.prototype.filter = ""; + + /** + * ListOffersRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListOffersRequest + * @instance + */ + ListOffersRequest.prototype.languageCode = ""; + + /** + * Creates a new ListOffersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {google.cloud.channel.v1.IListOffersRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListOffersRequest} ListOffersRequest instance + */ + ListOffersRequest.create = function create(properties) { + return new ListOffersRequest(properties); + }; + + /** + * Encodes the specified ListOffersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListOffersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {google.cloud.channel.v1.IListOffersRequest} message ListOffersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOffersRequest.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.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListOffersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListOffersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {google.cloud.channel.v1.IListOffersRequest} message ListOffersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOffersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOffersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListOffersRequest} ListOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOffersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListOffersRequest(); + 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.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOffersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListOffersRequest} ListOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOffersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOffersRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOffersRequest.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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListOffersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListOffersRequest} ListOffersRequest + */ + ListOffersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListOffersRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListOffersRequest(); + 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.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListOffersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {google.cloud.channel.v1.ListOffersRequest} message ListOffersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOffersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.languageCode = ""; + } + 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.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListOffersRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListOffersRequest + * @instance + * @returns {Object.} JSON object + */ + ListOffersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOffersRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListOffersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOffersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListOffersRequest"; + }; + + return ListOffersRequest; + })(); + + v1.ListOffersResponse = (function() { + + /** + * Properties of a ListOffersResponse. + * @memberof google.cloud.channel.v1 + * @interface IListOffersResponse + * @property {Array.|null} [offers] ListOffersResponse offers + * @property {string|null} [nextPageToken] ListOffersResponse nextPageToken + */ + + /** + * Constructs a new ListOffersResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListOffersResponse. + * @implements IListOffersResponse + * @constructor + * @param {google.cloud.channel.v1.IListOffersResponse=} [properties] Properties to set + */ + function ListOffersResponse(properties) { + this.offers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOffersResponse offers. + * @member {Array.} offers + * @memberof google.cloud.channel.v1.ListOffersResponse + * @instance + */ + ListOffersResponse.prototype.offers = $util.emptyArray; + + /** + * ListOffersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListOffersResponse + * @instance + */ + ListOffersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOffersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {google.cloud.channel.v1.IListOffersResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListOffersResponse} ListOffersResponse instance + */ + ListOffersResponse.create = function create(properties) { + return new ListOffersResponse(properties); + }; + + /** + * Encodes the specified ListOffersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListOffersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {google.cloud.channel.v1.IListOffersResponse} message ListOffersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOffersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offers != null && message.offers.length) + for (var i = 0; i < message.offers.length; ++i) + $root.google.cloud.channel.v1.Offer.encode(message.offers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOffersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListOffersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {google.cloud.channel.v1.IListOffersResponse} message ListOffersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOffersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOffersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListOffersResponse} ListOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOffersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListOffersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.offers && message.offers.length)) + message.offers = []; + message.offers.push($root.google.cloud.channel.v1.Offer.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOffersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListOffersResponse} ListOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOffersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOffersResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOffersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offers != null && message.hasOwnProperty("offers")) { + if (!Array.isArray(message.offers)) + return "offers: array expected"; + for (var i = 0; i < message.offers.length; ++i) { + var error = $root.google.cloud.channel.v1.Offer.verify(message.offers[i]); + if (error) + return "offers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOffersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListOffersResponse} ListOffersResponse + */ + ListOffersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListOffersResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListOffersResponse(); + if (object.offers) { + if (!Array.isArray(object.offers)) + throw TypeError(".google.cloud.channel.v1.ListOffersResponse.offers: array expected"); + message.offers = []; + for (var i = 0; i < object.offers.length; ++i) { + if (typeof object.offers[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListOffersResponse.offers: object expected"); + message.offers[i] = $root.google.cloud.channel.v1.Offer.fromObject(object.offers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOffersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {google.cloud.channel.v1.ListOffersResponse} message ListOffersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOffersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.offers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.offers && message.offers.length) { + object.offers = []; + for (var j = 0; j < message.offers.length; ++j) + object.offers[j] = $root.google.cloud.channel.v1.Offer.toObject(message.offers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOffersResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListOffersResponse + * @instance + * @returns {Object.} JSON object + */ + ListOffersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOffersResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListOffersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOffersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListOffersResponse"; + }; + + return ListOffersResponse; + })(); + + v1.ListPurchasableSkusRequest = (function() { + + /** + * Properties of a ListPurchasableSkusRequest. + * @memberof google.cloud.channel.v1 + * @interface IListPurchasableSkusRequest + * @property {google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase|null} [createEntitlementPurchase] ListPurchasableSkusRequest createEntitlementPurchase + * @property {google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase|null} [changeOfferPurchase] ListPurchasableSkusRequest changeOfferPurchase + * @property {string|null} [customer] ListPurchasableSkusRequest customer + * @property {number|null} [pageSize] ListPurchasableSkusRequest pageSize + * @property {string|null} [pageToken] ListPurchasableSkusRequest pageToken + * @property {string|null} [languageCode] ListPurchasableSkusRequest languageCode + */ + + /** + * Constructs a new ListPurchasableSkusRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListPurchasableSkusRequest. + * @implements IListPurchasableSkusRequest + * @constructor + * @param {google.cloud.channel.v1.IListPurchasableSkusRequest=} [properties] Properties to set + */ + function ListPurchasableSkusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPurchasableSkusRequest createEntitlementPurchase. + * @member {google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase|null|undefined} createEntitlementPurchase + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + ListPurchasableSkusRequest.prototype.createEntitlementPurchase = null; + + /** + * ListPurchasableSkusRequest changeOfferPurchase. + * @member {google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase|null|undefined} changeOfferPurchase + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + ListPurchasableSkusRequest.prototype.changeOfferPurchase = null; + + /** + * ListPurchasableSkusRequest customer. + * @member {string} customer + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + ListPurchasableSkusRequest.prototype.customer = ""; + + /** + * ListPurchasableSkusRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + ListPurchasableSkusRequest.prototype.pageSize = 0; + + /** + * ListPurchasableSkusRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + ListPurchasableSkusRequest.prototype.pageToken = ""; + + /** + * ListPurchasableSkusRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + ListPurchasableSkusRequest.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPurchasableSkusRequest purchaseOption. + * @member {"createEntitlementPurchase"|"changeOfferPurchase"|undefined} purchaseOption + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + */ + Object.defineProperty(ListPurchasableSkusRequest.prototype, "purchaseOption", { + get: $util.oneOfGetter($oneOfFields = ["createEntitlementPurchase", "changeOfferPurchase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPurchasableSkusRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {google.cloud.channel.v1.IListPurchasableSkusRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest} ListPurchasableSkusRequest instance + */ + ListPurchasableSkusRequest.create = function create(properties) { + return new ListPurchasableSkusRequest(properties); + }; + + /** + * Encodes the specified ListPurchasableSkusRequest message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {google.cloud.channel.v1.IListPurchasableSkusRequest} message ListPurchasableSkusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableSkusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.customer); + if (message.createEntitlementPurchase != null && Object.hasOwnProperty.call(message, "createEntitlementPurchase")) + $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.encode(message.createEntitlementPurchase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.changeOfferPurchase != null && Object.hasOwnProperty.call(message, "changeOfferPurchase")) + $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.encode(message.changeOfferPurchase, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListPurchasableSkusRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {google.cloud.channel.v1.IListPurchasableSkusRequest} message ListPurchasableSkusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableSkusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPurchasableSkusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest} ListPurchasableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableSkusRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableSkusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.createEntitlementPurchase = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.decode(reader, reader.uint32()); + break; + } + case 3: { + message.changeOfferPurchase = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.decode(reader, reader.uint32()); + break; + } + case 1: { + message.customer = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPurchasableSkusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest} ListPurchasableSkusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableSkusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPurchasableSkusRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPurchasableSkusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.createEntitlementPurchase != null && message.hasOwnProperty("createEntitlementPurchase")) { + properties.purchaseOption = 1; + { + var error = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.verify(message.createEntitlementPurchase); + if (error) + return "createEntitlementPurchase." + error; + } + } + if (message.changeOfferPurchase != null && message.hasOwnProperty("changeOfferPurchase")) { + if (properties.purchaseOption === 1) + return "purchaseOption: multiple values"; + properties.purchaseOption = 1; + { + var error = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.verify(message.changeOfferPurchase); + if (error) + return "changeOfferPurchase." + error; + } + } + if (message.customer != null && message.hasOwnProperty("customer")) + if (!$util.isString(message.customer)) + return "customer: 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListPurchasableSkusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest} ListPurchasableSkusRequest + */ + ListPurchasableSkusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableSkusRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableSkusRequest(); + if (object.createEntitlementPurchase != null) { + if (typeof object.createEntitlementPurchase !== "object") + throw TypeError(".google.cloud.channel.v1.ListPurchasableSkusRequest.createEntitlementPurchase: object expected"); + message.createEntitlementPurchase = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.fromObject(object.createEntitlementPurchase); + } + if (object.changeOfferPurchase != null) { + if (typeof object.changeOfferPurchase !== "object") + throw TypeError(".google.cloud.channel.v1.ListPurchasableSkusRequest.changeOfferPurchase: object expected"); + message.changeOfferPurchase = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.fromObject(object.changeOfferPurchase); + } + if (object.customer != null) + message.customer = String(object.customer); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListPurchasableSkusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest} message ListPurchasableSkusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPurchasableSkusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customer = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = message.customer; + if (message.createEntitlementPurchase != null && message.hasOwnProperty("createEntitlementPurchase")) { + object.createEntitlementPurchase = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.toObject(message.createEntitlementPurchase, options); + if (options.oneofs) + object.purchaseOption = "createEntitlementPurchase"; + } + if (message.changeOfferPurchase != null && message.hasOwnProperty("changeOfferPurchase")) { + object.changeOfferPurchase = $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.toObject(message.changeOfferPurchase, options); + if (options.oneofs) + object.purchaseOption = "changeOfferPurchase"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListPurchasableSkusRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @instance + * @returns {Object.} JSON object + */ + ListPurchasableSkusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPurchasableSkusRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPurchasableSkusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableSkusRequest"; + }; + + ListPurchasableSkusRequest.CreateEntitlementPurchase = (function() { + + /** + * Properties of a CreateEntitlementPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @interface ICreateEntitlementPurchase + * @property {string|null} [product] CreateEntitlementPurchase product + */ + + /** + * Constructs a new CreateEntitlementPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @classdesc Represents a CreateEntitlementPurchase. + * @implements ICreateEntitlementPurchase + * @constructor + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase=} [properties] Properties to set + */ + function CreateEntitlementPurchase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEntitlementPurchase product. + * @member {string} product + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @instance + */ + CreateEntitlementPurchase.prototype.product = ""; + + /** + * Creates a new CreateEntitlementPurchase instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} CreateEntitlementPurchase instance + */ + CreateEntitlementPurchase.create = function create(properties) { + return new CreateEntitlementPurchase(properties); + }; + + /** + * Encodes the specified CreateEntitlementPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase} message CreateEntitlementPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntitlementPurchase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.product); + return writer; + }; + + /** + * Encodes the specified CreateEntitlementPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ICreateEntitlementPurchase} message CreateEntitlementPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntitlementPurchase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntitlementPurchase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.product = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntitlementPurchase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEntitlementPurchase message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntitlementPurchase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.product != null && message.hasOwnProperty("product")) + if (!$util.isString(message.product)) + return "product: string expected"; + return null; + }; + + /** + * Creates a CreateEntitlementPurchase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} CreateEntitlementPurchase + */ + CreateEntitlementPurchase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase(); + if (object.product != null) + message.product = String(object.product); + return message; + }; + + /** + * Creates a plain object from a CreateEntitlementPurchase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} message CreateEntitlementPurchase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntitlementPurchase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.product = ""; + if (message.product != null && message.hasOwnProperty("product")) + object.product = message.product; + return object; + }; + + /** + * Converts this CreateEntitlementPurchase to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @instance + * @returns {Object.} JSON object + */ + CreateEntitlementPurchase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEntitlementPurchase + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEntitlementPurchase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase"; + }; + + return CreateEntitlementPurchase; + })(); + + ListPurchasableSkusRequest.ChangeOfferPurchase = (function() { + + /** + * Properties of a ChangeOfferPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @interface IChangeOfferPurchase + * @property {string|null} [entitlement] ChangeOfferPurchase entitlement + * @property {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType|null} [changeType] ChangeOfferPurchase changeType + */ + + /** + * Constructs a new ChangeOfferPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest + * @classdesc Represents a ChangeOfferPurchase. + * @implements IChangeOfferPurchase + * @constructor + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase=} [properties] Properties to set + */ + function ChangeOfferPurchase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeOfferPurchase entitlement. + * @member {string} entitlement + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @instance + */ + ChangeOfferPurchase.prototype.entitlement = ""; + + /** + * ChangeOfferPurchase changeType. + * @member {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType} changeType + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @instance + */ + ChangeOfferPurchase.prototype.changeType = 0; + + /** + * Creates a new ChangeOfferPurchase instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} ChangeOfferPurchase instance + */ + ChangeOfferPurchase.create = function create(properties) { + return new ChangeOfferPurchase(properties); + }; + + /** + * Encodes the specified ChangeOfferPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase} message ChangeOfferPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeOfferPurchase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlement != null && Object.hasOwnProperty.call(message, "entitlement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entitlement); + if (message.changeType != null && Object.hasOwnProperty.call(message, "changeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.changeType); + return writer; + }; + + /** + * Encodes the specified ChangeOfferPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.IChangeOfferPurchase} message ChangeOfferPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeOfferPurchase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeOfferPurchase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entitlement = reader.string(); + break; + } + case 2: { + message.changeType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeOfferPurchase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeOfferPurchase message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeOfferPurchase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + if (!$util.isString(message.entitlement)) + return "entitlement: string expected"; + if (message.changeType != null && message.hasOwnProperty("changeType")) + switch (message.changeType) { + default: + return "changeType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ChangeOfferPurchase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} ChangeOfferPurchase + */ + ChangeOfferPurchase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase(); + if (object.entitlement != null) + message.entitlement = String(object.entitlement); + switch (object.changeType) { + default: + if (typeof object.changeType === "number") { + message.changeType = object.changeType; + break; + } + break; + case "CHANGE_TYPE_UNSPECIFIED": + case 0: + message.changeType = 0; + break; + case "UPGRADE": + case 1: + message.changeType = 1; + break; + case "DOWNGRADE": + case 2: + message.changeType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ChangeOfferPurchase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} message ChangeOfferPurchase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeOfferPurchase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entitlement = ""; + object.changeType = options.enums === String ? "CHANGE_TYPE_UNSPECIFIED" : 0; + } + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + object.entitlement = message.entitlement; + if (message.changeType != null && message.hasOwnProperty("changeType")) + object.changeType = options.enums === String ? $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType[message.changeType] === undefined ? message.changeType : $root.google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType[message.changeType] : message.changeType; + return object; + }; + + /** + * Converts this ChangeOfferPurchase to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @instance + * @returns {Object.} JSON object + */ + ChangeOfferPurchase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeOfferPurchase + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeOfferPurchase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase"; + }; + + /** + * ChangeType enum. + * @name google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase.ChangeType + * @enum {number} + * @property {number} CHANGE_TYPE_UNSPECIFIED=0 CHANGE_TYPE_UNSPECIFIED value + * @property {number} UPGRADE=1 UPGRADE value + * @property {number} DOWNGRADE=2 DOWNGRADE value + */ + ChangeOfferPurchase.ChangeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UPGRADE"] = 1; + values[valuesById[2] = "DOWNGRADE"] = 2; + return values; + })(); + + return ChangeOfferPurchase; + })(); + + return ListPurchasableSkusRequest; + })(); + + v1.ListPurchasableSkusResponse = (function() { + + /** + * Properties of a ListPurchasableSkusResponse. + * @memberof google.cloud.channel.v1 + * @interface IListPurchasableSkusResponse + * @property {Array.|null} [purchasableSkus] ListPurchasableSkusResponse purchasableSkus + * @property {string|null} [nextPageToken] ListPurchasableSkusResponse nextPageToken + */ + + /** + * Constructs a new ListPurchasableSkusResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListPurchasableSkusResponse. + * @implements IListPurchasableSkusResponse + * @constructor + * @param {google.cloud.channel.v1.IListPurchasableSkusResponse=} [properties] Properties to set + */ + function ListPurchasableSkusResponse(properties) { + this.purchasableSkus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPurchasableSkusResponse purchasableSkus. + * @member {Array.} purchasableSkus + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @instance + */ + ListPurchasableSkusResponse.prototype.purchasableSkus = $util.emptyArray; + + /** + * ListPurchasableSkusResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @instance + */ + ListPurchasableSkusResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPurchasableSkusResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {google.cloud.channel.v1.IListPurchasableSkusResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableSkusResponse} ListPurchasableSkusResponse instance + */ + ListPurchasableSkusResponse.create = function create(properties) { + return new ListPurchasableSkusResponse(properties); + }; + + /** + * Encodes the specified ListPurchasableSkusResponse message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {google.cloud.channel.v1.IListPurchasableSkusResponse} message ListPurchasableSkusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableSkusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purchasableSkus != null && message.purchasableSkus.length) + for (var i = 0; i < message.purchasableSkus.length; ++i) + $root.google.cloud.channel.v1.PurchasableSku.encode(message.purchasableSkus[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPurchasableSkusResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableSkusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {google.cloud.channel.v1.IListPurchasableSkusResponse} message ListPurchasableSkusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableSkusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPurchasableSkusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableSkusResponse} ListPurchasableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableSkusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableSkusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.purchasableSkus && message.purchasableSkus.length)) + message.purchasableSkus = []; + message.purchasableSkus.push($root.google.cloud.channel.v1.PurchasableSku.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPurchasableSkusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableSkusResponse} ListPurchasableSkusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableSkusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPurchasableSkusResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPurchasableSkusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purchasableSkus != null && message.hasOwnProperty("purchasableSkus")) { + if (!Array.isArray(message.purchasableSkus)) + return "purchasableSkus: array expected"; + for (var i = 0; i < message.purchasableSkus.length; ++i) { + var error = $root.google.cloud.channel.v1.PurchasableSku.verify(message.purchasableSkus[i]); + if (error) + return "purchasableSkus." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPurchasableSkusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableSkusResponse} ListPurchasableSkusResponse + */ + ListPurchasableSkusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableSkusResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableSkusResponse(); + if (object.purchasableSkus) { + if (!Array.isArray(object.purchasableSkus)) + throw TypeError(".google.cloud.channel.v1.ListPurchasableSkusResponse.purchasableSkus: array expected"); + message.purchasableSkus = []; + for (var i = 0; i < object.purchasableSkus.length; ++i) { + if (typeof object.purchasableSkus[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListPurchasableSkusResponse.purchasableSkus: object expected"); + message.purchasableSkus[i] = $root.google.cloud.channel.v1.PurchasableSku.fromObject(object.purchasableSkus[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPurchasableSkusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {google.cloud.channel.v1.ListPurchasableSkusResponse} message ListPurchasableSkusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPurchasableSkusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purchasableSkus = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.purchasableSkus && message.purchasableSkus.length) { + object.purchasableSkus = []; + for (var j = 0; j < message.purchasableSkus.length; ++j) + object.purchasableSkus[j] = $root.google.cloud.channel.v1.PurchasableSku.toObject(message.purchasableSkus[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPurchasableSkusResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @instance + * @returns {Object.} JSON object + */ + ListPurchasableSkusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPurchasableSkusResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableSkusResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPurchasableSkusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableSkusResponse"; + }; + + return ListPurchasableSkusResponse; + })(); + + v1.PurchasableSku = (function() { + + /** + * Properties of a PurchasableSku. + * @memberof google.cloud.channel.v1 + * @interface IPurchasableSku + * @property {google.cloud.channel.v1.ISku|null} [sku] PurchasableSku sku + */ + + /** + * Constructs a new PurchasableSku. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a PurchasableSku. + * @implements IPurchasableSku + * @constructor + * @param {google.cloud.channel.v1.IPurchasableSku=} [properties] Properties to set + */ + function PurchasableSku(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurchasableSku sku. + * @member {google.cloud.channel.v1.ISku|null|undefined} sku + * @memberof google.cloud.channel.v1.PurchasableSku + * @instance + */ + PurchasableSku.prototype.sku = null; + + /** + * Creates a new PurchasableSku instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {google.cloud.channel.v1.IPurchasableSku=} [properties] Properties to set + * @returns {google.cloud.channel.v1.PurchasableSku} PurchasableSku instance + */ + PurchasableSku.create = function create(properties) { + return new PurchasableSku(properties); + }; + + /** + * Encodes the specified PurchasableSku message. Does not implicitly {@link google.cloud.channel.v1.PurchasableSku.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {google.cloud.channel.v1.IPurchasableSku} message PurchasableSku message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchasableSku.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sku != null && Object.hasOwnProperty.call(message, "sku")) + $root.google.cloud.channel.v1.Sku.encode(message.sku, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PurchasableSku message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PurchasableSku.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {google.cloud.channel.v1.IPurchasableSku} message PurchasableSku message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchasableSku.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurchasableSku message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.PurchasableSku} PurchasableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchasableSku.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.PurchasableSku(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sku = $root.google.cloud.channel.v1.Sku.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurchasableSku message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.PurchasableSku} PurchasableSku + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchasableSku.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurchasableSku message. + * @function verify + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurchasableSku.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sku != null && message.hasOwnProperty("sku")) { + var error = $root.google.cloud.channel.v1.Sku.verify(message.sku); + if (error) + return "sku." + error; + } + return null; + }; + + /** + * Creates a PurchasableSku message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.PurchasableSku} PurchasableSku + */ + PurchasableSku.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.PurchasableSku) + return object; + var message = new $root.google.cloud.channel.v1.PurchasableSku(); + if (object.sku != null) { + if (typeof object.sku !== "object") + throw TypeError(".google.cloud.channel.v1.PurchasableSku.sku: object expected"); + message.sku = $root.google.cloud.channel.v1.Sku.fromObject(object.sku); + } + return message; + }; + + /** + * Creates a plain object from a PurchasableSku message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {google.cloud.channel.v1.PurchasableSku} message PurchasableSku + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurchasableSku.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sku = null; + if (message.sku != null && message.hasOwnProperty("sku")) + object.sku = $root.google.cloud.channel.v1.Sku.toObject(message.sku, options); + return object; + }; + + /** + * Converts this PurchasableSku to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.PurchasableSku + * @instance + * @returns {Object.} JSON object + */ + PurchasableSku.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurchasableSku + * @function getTypeUrl + * @memberof google.cloud.channel.v1.PurchasableSku + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurchasableSku.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.PurchasableSku"; + }; + + return PurchasableSku; + })(); + + v1.ListPurchasableOffersRequest = (function() { + + /** + * Properties of a ListPurchasableOffersRequest. + * @memberof google.cloud.channel.v1 + * @interface IListPurchasableOffersRequest + * @property {google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase|null} [createEntitlementPurchase] ListPurchasableOffersRequest createEntitlementPurchase + * @property {google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase|null} [changeOfferPurchase] ListPurchasableOffersRequest changeOfferPurchase + * @property {string|null} [customer] ListPurchasableOffersRequest customer + * @property {number|null} [pageSize] ListPurchasableOffersRequest pageSize + * @property {string|null} [pageToken] ListPurchasableOffersRequest pageToken + * @property {string|null} [languageCode] ListPurchasableOffersRequest languageCode + */ + + /** + * Constructs a new ListPurchasableOffersRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListPurchasableOffersRequest. + * @implements IListPurchasableOffersRequest + * @constructor + * @param {google.cloud.channel.v1.IListPurchasableOffersRequest=} [properties] Properties to set + */ + function ListPurchasableOffersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPurchasableOffersRequest createEntitlementPurchase. + * @member {google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase|null|undefined} createEntitlementPurchase + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + ListPurchasableOffersRequest.prototype.createEntitlementPurchase = null; + + /** + * ListPurchasableOffersRequest changeOfferPurchase. + * @member {google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase|null|undefined} changeOfferPurchase + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + ListPurchasableOffersRequest.prototype.changeOfferPurchase = null; + + /** + * ListPurchasableOffersRequest customer. + * @member {string} customer + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + ListPurchasableOffersRequest.prototype.customer = ""; + + /** + * ListPurchasableOffersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + ListPurchasableOffersRequest.prototype.pageSize = 0; + + /** + * ListPurchasableOffersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + ListPurchasableOffersRequest.prototype.pageToken = ""; + + /** + * ListPurchasableOffersRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + ListPurchasableOffersRequest.prototype.languageCode = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPurchasableOffersRequest purchaseOption. + * @member {"createEntitlementPurchase"|"changeOfferPurchase"|undefined} purchaseOption + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + */ + Object.defineProperty(ListPurchasableOffersRequest.prototype, "purchaseOption", { + get: $util.oneOfGetter($oneOfFields = ["createEntitlementPurchase", "changeOfferPurchase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPurchasableOffersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {google.cloud.channel.v1.IListPurchasableOffersRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest} ListPurchasableOffersRequest instance + */ + ListPurchasableOffersRequest.create = function create(properties) { + return new ListPurchasableOffersRequest(properties); + }; + + /** + * Encodes the specified ListPurchasableOffersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {google.cloud.channel.v1.IListPurchasableOffersRequest} message ListPurchasableOffersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableOffersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.customer); + if (message.createEntitlementPurchase != null && Object.hasOwnProperty.call(message, "createEntitlementPurchase")) + $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.encode(message.createEntitlementPurchase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.changeOfferPurchase != null && Object.hasOwnProperty.call(message, "changeOfferPurchase")) + $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.encode(message.changeOfferPurchase, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified ListPurchasableOffersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {google.cloud.channel.v1.IListPurchasableOffersRequest} message ListPurchasableOffersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableOffersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPurchasableOffersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest} ListPurchasableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableOffersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.createEntitlementPurchase = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.decode(reader, reader.uint32()); + break; + } + case 3: { + message.changeOfferPurchase = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.decode(reader, reader.uint32()); + break; + } + case 1: { + message.customer = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPurchasableOffersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest} ListPurchasableOffersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableOffersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPurchasableOffersRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPurchasableOffersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.createEntitlementPurchase != null && message.hasOwnProperty("createEntitlementPurchase")) { + properties.purchaseOption = 1; + { + var error = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.verify(message.createEntitlementPurchase); + if (error) + return "createEntitlementPurchase." + error; + } + } + if (message.changeOfferPurchase != null && message.hasOwnProperty("changeOfferPurchase")) { + if (properties.purchaseOption === 1) + return "purchaseOption: multiple values"; + properties.purchaseOption = 1; + { + var error = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.verify(message.changeOfferPurchase); + if (error) + return "changeOfferPurchase." + error; + } + } + if (message.customer != null && message.hasOwnProperty("customer")) + if (!$util.isString(message.customer)) + return "customer: 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.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a ListPurchasableOffersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest} ListPurchasableOffersRequest + */ + ListPurchasableOffersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableOffersRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest(); + if (object.createEntitlementPurchase != null) { + if (typeof object.createEntitlementPurchase !== "object") + throw TypeError(".google.cloud.channel.v1.ListPurchasableOffersRequest.createEntitlementPurchase: object expected"); + message.createEntitlementPurchase = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.fromObject(object.createEntitlementPurchase); + } + if (object.changeOfferPurchase != null) { + if (typeof object.changeOfferPurchase !== "object") + throw TypeError(".google.cloud.channel.v1.ListPurchasableOffersRequest.changeOfferPurchase: object expected"); + message.changeOfferPurchase = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.fromObject(object.changeOfferPurchase); + } + if (object.customer != null) + message.customer = String(object.customer); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a ListPurchasableOffersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest} message ListPurchasableOffersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPurchasableOffersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customer = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + } + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = message.customer; + if (message.createEntitlementPurchase != null && message.hasOwnProperty("createEntitlementPurchase")) { + object.createEntitlementPurchase = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.toObject(message.createEntitlementPurchase, options); + if (options.oneofs) + object.purchaseOption = "createEntitlementPurchase"; + } + if (message.changeOfferPurchase != null && message.hasOwnProperty("changeOfferPurchase")) { + object.changeOfferPurchase = $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.toObject(message.changeOfferPurchase, options); + if (options.oneofs) + object.purchaseOption = "changeOfferPurchase"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this ListPurchasableOffersRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @instance + * @returns {Object.} JSON object + */ + ListPurchasableOffersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPurchasableOffersRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPurchasableOffersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableOffersRequest"; + }; + + ListPurchasableOffersRequest.CreateEntitlementPurchase = (function() { + + /** + * Properties of a CreateEntitlementPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @interface ICreateEntitlementPurchase + * @property {string|null} [sku] CreateEntitlementPurchase sku + */ + + /** + * Constructs a new CreateEntitlementPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @classdesc Represents a CreateEntitlementPurchase. + * @implements ICreateEntitlementPurchase + * @constructor + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase=} [properties] Properties to set + */ + function CreateEntitlementPurchase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEntitlementPurchase sku. + * @member {string} sku + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @instance + */ + CreateEntitlementPurchase.prototype.sku = ""; + + /** + * Creates a new CreateEntitlementPurchase instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} CreateEntitlementPurchase instance + */ + CreateEntitlementPurchase.create = function create(properties) { + return new CreateEntitlementPurchase(properties); + }; + + /** + * Encodes the specified CreateEntitlementPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase} message CreateEntitlementPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntitlementPurchase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sku != null && Object.hasOwnProperty.call(message, "sku")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sku); + return writer; + }; + + /** + * Encodes the specified CreateEntitlementPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ICreateEntitlementPurchase} message CreateEntitlementPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntitlementPurchase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntitlementPurchase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sku = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEntitlementPurchase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} CreateEntitlementPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntitlementPurchase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEntitlementPurchase message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntitlementPurchase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sku != null && message.hasOwnProperty("sku")) + if (!$util.isString(message.sku)) + return "sku: string expected"; + return null; + }; + + /** + * Creates a CreateEntitlementPurchase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} CreateEntitlementPurchase + */ + CreateEntitlementPurchase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase(); + if (object.sku != null) + message.sku = String(object.sku); + return message; + }; + + /** + * Creates a plain object from a CreateEntitlementPurchase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} message CreateEntitlementPurchase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntitlementPurchase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sku = ""; + if (message.sku != null && message.hasOwnProperty("sku")) + object.sku = message.sku; + return object; + }; + + /** + * Converts this CreateEntitlementPurchase to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @instance + * @returns {Object.} JSON object + */ + CreateEntitlementPurchase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEntitlementPurchase + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEntitlementPurchase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase"; + }; + + return CreateEntitlementPurchase; + })(); + + ListPurchasableOffersRequest.ChangeOfferPurchase = (function() { + + /** + * Properties of a ChangeOfferPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @interface IChangeOfferPurchase + * @property {string|null} [entitlement] ChangeOfferPurchase entitlement + * @property {string|null} [newSku] ChangeOfferPurchase newSku + */ + + /** + * Constructs a new ChangeOfferPurchase. + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest + * @classdesc Represents a ChangeOfferPurchase. + * @implements IChangeOfferPurchase + * @constructor + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase=} [properties] Properties to set + */ + function ChangeOfferPurchase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChangeOfferPurchase entitlement. + * @member {string} entitlement + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @instance + */ + ChangeOfferPurchase.prototype.entitlement = ""; + + /** + * ChangeOfferPurchase newSku. + * @member {string} newSku + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @instance + */ + ChangeOfferPurchase.prototype.newSku = ""; + + /** + * Creates a new ChangeOfferPurchase instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} ChangeOfferPurchase instance + */ + ChangeOfferPurchase.create = function create(properties) { + return new ChangeOfferPurchase(properties); + }; + + /** + * Encodes the specified ChangeOfferPurchase message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase} message ChangeOfferPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeOfferPurchase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlement != null && Object.hasOwnProperty.call(message, "entitlement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entitlement); + if (message.newSku != null && Object.hasOwnProperty.call(message, "newSku")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.newSku); + return writer; + }; + + /** + * Encodes the specified ChangeOfferPurchase message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.IChangeOfferPurchase} message ChangeOfferPurchase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChangeOfferPurchase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeOfferPurchase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entitlement = reader.string(); + break; + } + case 2: { + message.newSku = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChangeOfferPurchase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} ChangeOfferPurchase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChangeOfferPurchase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChangeOfferPurchase message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChangeOfferPurchase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + if (!$util.isString(message.entitlement)) + return "entitlement: string expected"; + if (message.newSku != null && message.hasOwnProperty("newSku")) + if (!$util.isString(message.newSku)) + return "newSku: string expected"; + return null; + }; + + /** + * Creates a ChangeOfferPurchase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} ChangeOfferPurchase + */ + ChangeOfferPurchase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase(); + if (object.entitlement != null) + message.entitlement = String(object.entitlement); + if (object.newSku != null) + message.newSku = String(object.newSku); + return message; + }; + + /** + * Creates a plain object from a ChangeOfferPurchase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} message ChangeOfferPurchase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChangeOfferPurchase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entitlement = ""; + object.newSku = ""; + } + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + object.entitlement = message.entitlement; + if (message.newSku != null && message.hasOwnProperty("newSku")) + object.newSku = message.newSku; + return object; + }; + + /** + * Converts this ChangeOfferPurchase to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @instance + * @returns {Object.} JSON object + */ + ChangeOfferPurchase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChangeOfferPurchase + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChangeOfferPurchase.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase"; + }; + + return ChangeOfferPurchase; + })(); + + return ListPurchasableOffersRequest; + })(); + + v1.ListPurchasableOffersResponse = (function() { + + /** + * Properties of a ListPurchasableOffersResponse. + * @memberof google.cloud.channel.v1 + * @interface IListPurchasableOffersResponse + * @property {Array.|null} [purchasableOffers] ListPurchasableOffersResponse purchasableOffers + * @property {string|null} [nextPageToken] ListPurchasableOffersResponse nextPageToken + */ + + /** + * Constructs a new ListPurchasableOffersResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListPurchasableOffersResponse. + * @implements IListPurchasableOffersResponse + * @constructor + * @param {google.cloud.channel.v1.IListPurchasableOffersResponse=} [properties] Properties to set + */ + function ListPurchasableOffersResponse(properties) { + this.purchasableOffers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPurchasableOffersResponse purchasableOffers. + * @member {Array.} purchasableOffers + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @instance + */ + ListPurchasableOffersResponse.prototype.purchasableOffers = $util.emptyArray; + + /** + * ListPurchasableOffersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @instance + */ + ListPurchasableOffersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPurchasableOffersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {google.cloud.channel.v1.IListPurchasableOffersResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListPurchasableOffersResponse} ListPurchasableOffersResponse instance + */ + ListPurchasableOffersResponse.create = function create(properties) { + return new ListPurchasableOffersResponse(properties); + }; + + /** + * Encodes the specified ListPurchasableOffersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {google.cloud.channel.v1.IListPurchasableOffersResponse} message ListPurchasableOffersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableOffersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.purchasableOffers != null && message.purchasableOffers.length) + for (var i = 0; i < message.purchasableOffers.length; ++i) + $root.google.cloud.channel.v1.PurchasableOffer.encode(message.purchasableOffers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPurchasableOffersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListPurchasableOffersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {google.cloud.channel.v1.IListPurchasableOffersResponse} message ListPurchasableOffersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPurchasableOffersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPurchasableOffersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListPurchasableOffersResponse} ListPurchasableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableOffersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListPurchasableOffersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.purchasableOffers && message.purchasableOffers.length)) + message.purchasableOffers = []; + message.purchasableOffers.push($root.google.cloud.channel.v1.PurchasableOffer.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPurchasableOffersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListPurchasableOffersResponse} ListPurchasableOffersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPurchasableOffersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPurchasableOffersResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPurchasableOffersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.purchasableOffers != null && message.hasOwnProperty("purchasableOffers")) { + if (!Array.isArray(message.purchasableOffers)) + return "purchasableOffers: array expected"; + for (var i = 0; i < message.purchasableOffers.length; ++i) { + var error = $root.google.cloud.channel.v1.PurchasableOffer.verify(message.purchasableOffers[i]); + if (error) + return "purchasableOffers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPurchasableOffersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListPurchasableOffersResponse} ListPurchasableOffersResponse + */ + ListPurchasableOffersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListPurchasableOffersResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListPurchasableOffersResponse(); + if (object.purchasableOffers) { + if (!Array.isArray(object.purchasableOffers)) + throw TypeError(".google.cloud.channel.v1.ListPurchasableOffersResponse.purchasableOffers: array expected"); + message.purchasableOffers = []; + for (var i = 0; i < object.purchasableOffers.length; ++i) { + if (typeof object.purchasableOffers[i] !== "object") + throw TypeError(".google.cloud.channel.v1.ListPurchasableOffersResponse.purchasableOffers: object expected"); + message.purchasableOffers[i] = $root.google.cloud.channel.v1.PurchasableOffer.fromObject(object.purchasableOffers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPurchasableOffersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {google.cloud.channel.v1.ListPurchasableOffersResponse} message ListPurchasableOffersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPurchasableOffersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.purchasableOffers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.purchasableOffers && message.purchasableOffers.length) { + object.purchasableOffers = []; + for (var j = 0; j < message.purchasableOffers.length; ++j) + object.purchasableOffers[j] = $root.google.cloud.channel.v1.PurchasableOffer.toObject(message.purchasableOffers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPurchasableOffersResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @instance + * @returns {Object.} JSON object + */ + ListPurchasableOffersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPurchasableOffersResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListPurchasableOffersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPurchasableOffersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListPurchasableOffersResponse"; + }; + + return ListPurchasableOffersResponse; + })(); + + v1.PurchasableOffer = (function() { + + /** + * Properties of a PurchasableOffer. + * @memberof google.cloud.channel.v1 + * @interface IPurchasableOffer + * @property {google.cloud.channel.v1.IOffer|null} [offer] PurchasableOffer offer + */ + + /** + * Constructs a new PurchasableOffer. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a PurchasableOffer. + * @implements IPurchasableOffer + * @constructor + * @param {google.cloud.channel.v1.IPurchasableOffer=} [properties] Properties to set + */ + function PurchasableOffer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PurchasableOffer offer. + * @member {google.cloud.channel.v1.IOffer|null|undefined} offer + * @memberof google.cloud.channel.v1.PurchasableOffer + * @instance + */ + PurchasableOffer.prototype.offer = null; + + /** + * Creates a new PurchasableOffer instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {google.cloud.channel.v1.IPurchasableOffer=} [properties] Properties to set + * @returns {google.cloud.channel.v1.PurchasableOffer} PurchasableOffer instance + */ + PurchasableOffer.create = function create(properties) { + return new PurchasableOffer(properties); + }; + + /** + * Encodes the specified PurchasableOffer message. Does not implicitly {@link google.cloud.channel.v1.PurchasableOffer.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {google.cloud.channel.v1.IPurchasableOffer} message PurchasableOffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchasableOffer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + $root.google.cloud.channel.v1.Offer.encode(message.offer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PurchasableOffer message, length delimited. Does not implicitly {@link google.cloud.channel.v1.PurchasableOffer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {google.cloud.channel.v1.IPurchasableOffer} message PurchasableOffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PurchasableOffer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PurchasableOffer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.PurchasableOffer} PurchasableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchasableOffer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.PurchasableOffer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.offer = $root.google.cloud.channel.v1.Offer.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PurchasableOffer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.PurchasableOffer} PurchasableOffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PurchasableOffer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PurchasableOffer message. + * @function verify + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PurchasableOffer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offer != null && message.hasOwnProperty("offer")) { + var error = $root.google.cloud.channel.v1.Offer.verify(message.offer); + if (error) + return "offer." + error; + } + return null; + }; + + /** + * Creates a PurchasableOffer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.PurchasableOffer} PurchasableOffer + */ + PurchasableOffer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.PurchasableOffer) + return object; + var message = new $root.google.cloud.channel.v1.PurchasableOffer(); + if (object.offer != null) { + if (typeof object.offer !== "object") + throw TypeError(".google.cloud.channel.v1.PurchasableOffer.offer: object expected"); + message.offer = $root.google.cloud.channel.v1.Offer.fromObject(object.offer); + } + return message; + }; + + /** + * Creates a plain object from a PurchasableOffer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {google.cloud.channel.v1.PurchasableOffer} message PurchasableOffer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PurchasableOffer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.offer = null; + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = $root.google.cloud.channel.v1.Offer.toObject(message.offer, options); + return object; + }; + + /** + * Converts this PurchasableOffer to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.PurchasableOffer + * @instance + * @returns {Object.} JSON object + */ + PurchasableOffer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PurchasableOffer + * @function getTypeUrl + * @memberof google.cloud.channel.v1.PurchasableOffer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PurchasableOffer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.PurchasableOffer"; + }; + + return PurchasableOffer; + })(); + + v1.RegisterSubscriberRequest = (function() { + + /** + * Properties of a RegisterSubscriberRequest. + * @memberof google.cloud.channel.v1 + * @interface IRegisterSubscriberRequest + * @property {string|null} [account] RegisterSubscriberRequest account + * @property {string|null} [serviceAccount] RegisterSubscriberRequest serviceAccount + */ + + /** + * Constructs a new RegisterSubscriberRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RegisterSubscriberRequest. + * @implements IRegisterSubscriberRequest + * @constructor + * @param {google.cloud.channel.v1.IRegisterSubscriberRequest=} [properties] Properties to set + */ + function RegisterSubscriberRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegisterSubscriberRequest account. + * @member {string} account + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @instance + */ + RegisterSubscriberRequest.prototype.account = ""; + + /** + * RegisterSubscriberRequest serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @instance + */ + RegisterSubscriberRequest.prototype.serviceAccount = ""; + + /** + * Creates a new RegisterSubscriberRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.IRegisterSubscriberRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RegisterSubscriberRequest} RegisterSubscriberRequest instance + */ + RegisterSubscriberRequest.create = function create(properties) { + return new RegisterSubscriberRequest(properties); + }; + + /** + * Encodes the specified RegisterSubscriberRequest message. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.IRegisterSubscriberRequest} message RegisterSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegisterSubscriberRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.account); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified RegisterSubscriberRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.IRegisterSubscriberRequest} message RegisterSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegisterSubscriberRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegisterSubscriberRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RegisterSubscriberRequest} RegisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegisterSubscriberRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RegisterSubscriberRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.account = reader.string(); + break; + } + case 2: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegisterSubscriberRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RegisterSubscriberRequest} RegisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegisterSubscriberRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegisterSubscriberRequest message. + * @function verify + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegisterSubscriberRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.account != null && message.hasOwnProperty("account")) + if (!$util.isString(message.account)) + return "account: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a RegisterSubscriberRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RegisterSubscriberRequest} RegisterSubscriberRequest + */ + RegisterSubscriberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RegisterSubscriberRequest) + return object; + var message = new $root.google.cloud.channel.v1.RegisterSubscriberRequest(); + if (object.account != null) + message.account = String(object.account); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a RegisterSubscriberRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.RegisterSubscriberRequest} message RegisterSubscriberRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegisterSubscriberRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.account = ""; + object.serviceAccount = ""; + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = message.account; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this RegisterSubscriberRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @instance + * @returns {Object.} JSON object + */ + RegisterSubscriberRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegisterSubscriberRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RegisterSubscriberRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegisterSubscriberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RegisterSubscriberRequest"; + }; + + return RegisterSubscriberRequest; + })(); + + v1.RegisterSubscriberResponse = (function() { + + /** + * Properties of a RegisterSubscriberResponse. + * @memberof google.cloud.channel.v1 + * @interface IRegisterSubscriberResponse + * @property {string|null} [topic] RegisterSubscriberResponse topic + */ + + /** + * Constructs a new RegisterSubscriberResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RegisterSubscriberResponse. + * @implements IRegisterSubscriberResponse + * @constructor + * @param {google.cloud.channel.v1.IRegisterSubscriberResponse=} [properties] Properties to set + */ + function RegisterSubscriberResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegisterSubscriberResponse topic. + * @member {string} topic + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @instance + */ + RegisterSubscriberResponse.prototype.topic = ""; + + /** + * Creates a new RegisterSubscriberResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.IRegisterSubscriberResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RegisterSubscriberResponse} RegisterSubscriberResponse instance + */ + RegisterSubscriberResponse.create = function create(properties) { + return new RegisterSubscriberResponse(properties); + }; + + /** + * Encodes the specified RegisterSubscriberResponse message. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.IRegisterSubscriberResponse} message RegisterSubscriberResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegisterSubscriberResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified RegisterSubscriberResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RegisterSubscriberResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.IRegisterSubscriberResponse} message RegisterSubscriberResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegisterSubscriberResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegisterSubscriberResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.RegisterSubscriberResponse} RegisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegisterSubscriberResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.RegisterSubscriberResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegisterSubscriberResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RegisterSubscriberResponse} RegisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegisterSubscriberResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegisterSubscriberResponse message. + * @function verify + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegisterSubscriberResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a RegisterSubscriberResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RegisterSubscriberResponse} RegisterSubscriberResponse + */ + RegisterSubscriberResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RegisterSubscriberResponse) + return object; + var message = new $root.google.cloud.channel.v1.RegisterSubscriberResponse(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a RegisterSubscriberResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.RegisterSubscriberResponse} message RegisterSubscriberResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegisterSubscriberResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this RegisterSubscriberResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @instance + * @returns {Object.} JSON object + */ + RegisterSubscriberResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegisterSubscriberResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RegisterSubscriberResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegisterSubscriberResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RegisterSubscriberResponse"; + }; + + return RegisterSubscriberResponse; + })(); + + v1.UnregisterSubscriberRequest = (function() { + + /** + * Properties of an UnregisterSubscriberRequest. + * @memberof google.cloud.channel.v1 + * @interface IUnregisterSubscriberRequest + * @property {string|null} [account] UnregisterSubscriberRequest account + * @property {string|null} [serviceAccount] UnregisterSubscriberRequest serviceAccount + */ + + /** + * Constructs a new UnregisterSubscriberRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an UnregisterSubscriberRequest. + * @implements IUnregisterSubscriberRequest + * @constructor + * @param {google.cloud.channel.v1.IUnregisterSubscriberRequest=} [properties] Properties to set + */ + function UnregisterSubscriberRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnregisterSubscriberRequest account. + * @member {string} account + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @instance + */ + UnregisterSubscriberRequest.prototype.account = ""; + + /** + * UnregisterSubscriberRequest serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @instance + */ + UnregisterSubscriberRequest.prototype.serviceAccount = ""; + + /** + * Creates a new UnregisterSubscriberRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.IUnregisterSubscriberRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.UnregisterSubscriberRequest} UnregisterSubscriberRequest instance + */ + UnregisterSubscriberRequest.create = function create(properties) { + return new UnregisterSubscriberRequest(properties); + }; + + /** + * Encodes the specified UnregisterSubscriberRequest message. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.IUnregisterSubscriberRequest} message UnregisterSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnregisterSubscriberRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.account); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified UnregisterSubscriberRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.IUnregisterSubscriberRequest} message UnregisterSubscriberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnregisterSubscriberRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnregisterSubscriberRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.UnregisterSubscriberRequest} UnregisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnregisterSubscriberRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.UnregisterSubscriberRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.account = reader.string(); + break; + } + case 2: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnregisterSubscriberRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.UnregisterSubscriberRequest} UnregisterSubscriberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnregisterSubscriberRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnregisterSubscriberRequest message. + * @function verify + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnregisterSubscriberRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.account != null && message.hasOwnProperty("account")) + if (!$util.isString(message.account)) + return "account: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates an UnregisterSubscriberRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.UnregisterSubscriberRequest} UnregisterSubscriberRequest + */ + UnregisterSubscriberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.UnregisterSubscriberRequest) + return object; + var message = new $root.google.cloud.channel.v1.UnregisterSubscriberRequest(); + if (object.account != null) + message.account = String(object.account); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from an UnregisterSubscriberRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {google.cloud.channel.v1.UnregisterSubscriberRequest} message UnregisterSubscriberRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnregisterSubscriberRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.account = ""; + object.serviceAccount = ""; + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = message.account; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this UnregisterSubscriberRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @instance + * @returns {Object.} JSON object + */ + UnregisterSubscriberRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnregisterSubscriberRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.UnregisterSubscriberRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnregisterSubscriberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.UnregisterSubscriberRequest"; + }; + + return UnregisterSubscriberRequest; + })(); + + v1.UnregisterSubscriberResponse = (function() { + + /** + * Properties of an UnregisterSubscriberResponse. + * @memberof google.cloud.channel.v1 + * @interface IUnregisterSubscriberResponse + * @property {string|null} [topic] UnregisterSubscriberResponse topic + */ + + /** + * Constructs a new UnregisterSubscriberResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an UnregisterSubscriberResponse. + * @implements IUnregisterSubscriberResponse + * @constructor + * @param {google.cloud.channel.v1.IUnregisterSubscriberResponse=} [properties] Properties to set + */ + function UnregisterSubscriberResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnregisterSubscriberResponse topic. + * @member {string} topic + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @instance + */ + UnregisterSubscriberResponse.prototype.topic = ""; + + /** + * Creates a new UnregisterSubscriberResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.IUnregisterSubscriberResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.UnregisterSubscriberResponse} UnregisterSubscriberResponse instance + */ + UnregisterSubscriberResponse.create = function create(properties) { + return new UnregisterSubscriberResponse(properties); + }; + + /** + * Encodes the specified UnregisterSubscriberResponse message. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.IUnregisterSubscriberResponse} message UnregisterSubscriberResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnregisterSubscriberResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified UnregisterSubscriberResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.UnregisterSubscriberResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.IUnregisterSubscriberResponse} message UnregisterSubscriberResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnregisterSubscriberResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnregisterSubscriberResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.UnregisterSubscriberResponse} UnregisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnregisterSubscriberResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.UnregisterSubscriberResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnregisterSubscriberResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.UnregisterSubscriberResponse} UnregisterSubscriberResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnregisterSubscriberResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnregisterSubscriberResponse message. + * @function verify + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnregisterSubscriberResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates an UnregisterSubscriberResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.UnregisterSubscriberResponse} UnregisterSubscriberResponse + */ + UnregisterSubscriberResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.UnregisterSubscriberResponse) + return object; + var message = new $root.google.cloud.channel.v1.UnregisterSubscriberResponse(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from an UnregisterSubscriberResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {google.cloud.channel.v1.UnregisterSubscriberResponse} message UnregisterSubscriberResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnregisterSubscriberResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this UnregisterSubscriberResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @instance + * @returns {Object.} JSON object + */ + UnregisterSubscriberResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnregisterSubscriberResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.UnregisterSubscriberResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnregisterSubscriberResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.UnregisterSubscriberResponse"; + }; + + return UnregisterSubscriberResponse; + })(); + + v1.ListSubscribersRequest = (function() { + + /** + * Properties of a ListSubscribersRequest. + * @memberof google.cloud.channel.v1 + * @interface IListSubscribersRequest + * @property {string|null} [account] ListSubscribersRequest account + * @property {number|null} [pageSize] ListSubscribersRequest pageSize + * @property {string|null} [pageToken] ListSubscribersRequest pageToken + */ + + /** + * Constructs a new ListSubscribersRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListSubscribersRequest. + * @implements IListSubscribersRequest + * @constructor + * @param {google.cloud.channel.v1.IListSubscribersRequest=} [properties] Properties to set + */ + function ListSubscribersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubscribersRequest account. + * @member {string} account + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @instance + */ + ListSubscribersRequest.prototype.account = ""; + + /** + * ListSubscribersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @instance + */ + ListSubscribersRequest.prototype.pageSize = 0; + + /** + * ListSubscribersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @instance + */ + ListSubscribersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubscribersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {google.cloud.channel.v1.IListSubscribersRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListSubscribersRequest} ListSubscribersRequest instance + */ + ListSubscribersRequest.create = function create(properties) { + return new ListSubscribersRequest(properties); + }; + + /** + * Encodes the specified ListSubscribersRequest message. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {google.cloud.channel.v1.IListSubscribersRequest} message ListSubscribersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscribersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.account); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSubscribersRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {google.cloud.channel.v1.IListSubscribersRequest} message ListSubscribersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscribersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubscribersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListSubscribersRequest} ListSubscribersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscribersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListSubscribersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.account = 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 ListSubscribersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListSubscribersRequest} ListSubscribersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscribersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscribersRequest message. + * @function verify + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscribersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.account != null && message.hasOwnProperty("account")) + if (!$util.isString(message.account)) + return "account: 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 ListSubscribersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListSubscribersRequest} ListSubscribersRequest + */ + ListSubscribersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListSubscribersRequest) + return object; + var message = new $root.google.cloud.channel.v1.ListSubscribersRequest(); + if (object.account != null) + message.account = String(object.account); + 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 ListSubscribersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {google.cloud.channel.v1.ListSubscribersRequest} message ListSubscribersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubscribersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.account = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = message.account; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSubscribersRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @instance + * @returns {Object.} JSON object + */ + ListSubscribersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscribersRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListSubscribersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscribersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListSubscribersRequest"; + }; + + return ListSubscribersRequest; + })(); + + v1.ListSubscribersResponse = (function() { + + /** + * Properties of a ListSubscribersResponse. + * @memberof google.cloud.channel.v1 + * @interface IListSubscribersResponse + * @property {string|null} [topic] ListSubscribersResponse topic + * @property {Array.|null} [serviceAccounts] ListSubscribersResponse serviceAccounts + * @property {string|null} [nextPageToken] ListSubscribersResponse nextPageToken + */ + + /** + * Constructs a new ListSubscribersResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ListSubscribersResponse. + * @implements IListSubscribersResponse + * @constructor + * @param {google.cloud.channel.v1.IListSubscribersResponse=} [properties] Properties to set + */ + function ListSubscribersResponse(properties) { + this.serviceAccounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubscribersResponse topic. + * @member {string} topic + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @instance + */ + ListSubscribersResponse.prototype.topic = ""; + + /** + * ListSubscribersResponse serviceAccounts. + * @member {Array.} serviceAccounts + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @instance + */ + ListSubscribersResponse.prototype.serviceAccounts = $util.emptyArray; + + /** + * ListSubscribersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @instance + */ + ListSubscribersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSubscribersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {google.cloud.channel.v1.IListSubscribersResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ListSubscribersResponse} ListSubscribersResponse instance + */ + ListSubscribersResponse.create = function create(properties) { + return new ListSubscribersResponse(properties); + }; + + /** + * Encodes the specified ListSubscribersResponse message. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {google.cloud.channel.v1.IListSubscribersResponse} message ListSubscribersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscribersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.serviceAccounts != null && message.serviceAccounts.length) + for (var i = 0; i < message.serviceAccounts.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccounts[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSubscribersResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ListSubscribersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {google.cloud.channel.v1.IListSubscribersResponse} message ListSubscribersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubscribersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubscribersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.ListSubscribersResponse} ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscribersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.ListSubscribersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + if (!(message.serviceAccounts && message.serviceAccounts.length)) + message.serviceAccounts = []; + message.serviceAccounts.push(reader.string()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubscribersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ListSubscribersResponse} ListSubscribersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubscribersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubscribersResponse message. + * @function verify + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubscribersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { + if (!Array.isArray(message.serviceAccounts)) + return "serviceAccounts: array expected"; + for (var i = 0; i < message.serviceAccounts.length; ++i) + if (!$util.isString(message.serviceAccounts[i])) + return "serviceAccounts: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubscribersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ListSubscribersResponse} ListSubscribersResponse + */ + ListSubscribersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ListSubscribersResponse) + return object; + var message = new $root.google.cloud.channel.v1.ListSubscribersResponse(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.serviceAccounts) { + if (!Array.isArray(object.serviceAccounts)) + throw TypeError(".google.cloud.channel.v1.ListSubscribersResponse.serviceAccounts: array expected"); + message.serviceAccounts = []; + for (var i = 0; i < object.serviceAccounts.length; ++i) + message.serviceAccounts[i] = String(object.serviceAccounts[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubscribersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {google.cloud.channel.v1.ListSubscribersResponse} message ListSubscribersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubscribersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceAccounts = []; + if (options.defaults) { + object.topic = ""; + object.nextPageToken = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.serviceAccounts && message.serviceAccounts.length) { + object.serviceAccounts = []; + for (var j = 0; j < message.serviceAccounts.length; ++j) + object.serviceAccounts[j] = message.serviceAccounts[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSubscribersResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @instance + * @returns {Object.} JSON object + */ + ListSubscribersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubscribersResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ListSubscribersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubscribersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ListSubscribersResponse"; + }; + + return ListSubscribersResponse; + })(); + + v1.CustomerEvent = (function() { + + /** + * Properties of a CustomerEvent. + * @memberof google.cloud.channel.v1 + * @interface ICustomerEvent + * @property {string|null} [customer] CustomerEvent customer + * @property {google.cloud.channel.v1.CustomerEvent.Type|null} [eventType] CustomerEvent eventType + */ + + /** + * Constructs a new CustomerEvent. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a CustomerEvent. + * @implements ICustomerEvent + * @constructor + * @param {google.cloud.channel.v1.ICustomerEvent=} [properties] Properties to set + */ + function CustomerEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEvent customer. + * @member {string} customer + * @memberof google.cloud.channel.v1.CustomerEvent + * @instance + */ + CustomerEvent.prototype.customer = ""; + + /** + * CustomerEvent eventType. + * @member {google.cloud.channel.v1.CustomerEvent.Type} eventType + * @memberof google.cloud.channel.v1.CustomerEvent + * @instance + */ + CustomerEvent.prototype.eventType = 0; + + /** + * Creates a new CustomerEvent instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {google.cloud.channel.v1.ICustomerEvent=} [properties] Properties to set + * @returns {google.cloud.channel.v1.CustomerEvent} CustomerEvent instance + */ + CustomerEvent.create = function create(properties) { + return new CustomerEvent(properties); + }; + + /** + * Encodes the specified CustomerEvent message. Does not implicitly {@link google.cloud.channel.v1.CustomerEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {google.cloud.channel.v1.ICustomerEvent} message CustomerEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.customer); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.eventType); + return writer; + }; + + /** + * Encodes the specified CustomerEvent message, length delimited. Does not implicitly {@link google.cloud.channel.v1.CustomerEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {google.cloud.channel.v1.ICustomerEvent} message CustomerEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.CustomerEvent} CustomerEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.CustomerEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customer = reader.string(); + break; + } + case 2: { + message.eventType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.CustomerEvent} CustomerEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEvent message. + * @function verify + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customer != null && message.hasOwnProperty("customer")) + if (!$util.isString(message.customer)) + return "customer: string expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CustomerEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.CustomerEvent} CustomerEvent + */ + CustomerEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.CustomerEvent) + return object; + var message = new $root.google.cloud.channel.v1.CustomerEvent(); + if (object.customer != null) + message.customer = String(object.customer); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "PRIMARY_DOMAIN_CHANGED": + case 1: + message.eventType = 1; + break; + case "PRIMARY_DOMAIN_VERIFIED": + case 2: + message.eventType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CustomerEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {google.cloud.channel.v1.CustomerEvent} message CustomerEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customer = ""; + object.eventType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = message.customer; + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.channel.v1.CustomerEvent.Type[message.eventType] === undefined ? message.eventType : $root.google.cloud.channel.v1.CustomerEvent.Type[message.eventType] : message.eventType; + return object; + }; + + /** + * Converts this CustomerEvent to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.CustomerEvent + * @instance + * @returns {Object.} JSON object + */ + CustomerEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerEvent + * @function getTypeUrl + * @memberof google.cloud.channel.v1.CustomerEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.CustomerEvent"; + }; + + /** + * Type enum. + * @name google.cloud.channel.v1.CustomerEvent.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} PRIMARY_DOMAIN_CHANGED=1 PRIMARY_DOMAIN_CHANGED value + * @property {number} PRIMARY_DOMAIN_VERIFIED=2 PRIMARY_DOMAIN_VERIFIED value + */ + CustomerEvent.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIMARY_DOMAIN_CHANGED"] = 1; + values[valuesById[2] = "PRIMARY_DOMAIN_VERIFIED"] = 2; + return values; + })(); + + return CustomerEvent; + })(); + + v1.EntitlementEvent = (function() { + + /** + * Properties of an EntitlementEvent. + * @memberof google.cloud.channel.v1 + * @interface IEntitlementEvent + * @property {string|null} [entitlement] EntitlementEvent entitlement + * @property {google.cloud.channel.v1.EntitlementEvent.Type|null} [eventType] EntitlementEvent eventType + */ + + /** + * Constructs a new EntitlementEvent. + * @memberof google.cloud.channel.v1 + * @classdesc Represents an EntitlementEvent. + * @implements IEntitlementEvent + * @constructor + * @param {google.cloud.channel.v1.IEntitlementEvent=} [properties] Properties to set + */ + function EntitlementEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntitlementEvent entitlement. + * @member {string} entitlement + * @memberof google.cloud.channel.v1.EntitlementEvent + * @instance + */ + EntitlementEvent.prototype.entitlement = ""; + + /** + * EntitlementEvent eventType. + * @member {google.cloud.channel.v1.EntitlementEvent.Type} eventType + * @memberof google.cloud.channel.v1.EntitlementEvent + * @instance + */ + EntitlementEvent.prototype.eventType = 0; + + /** + * Creates a new EntitlementEvent instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {google.cloud.channel.v1.IEntitlementEvent=} [properties] Properties to set + * @returns {google.cloud.channel.v1.EntitlementEvent} EntitlementEvent instance + */ + EntitlementEvent.create = function create(properties) { + return new EntitlementEvent(properties); + }; + + /** + * Encodes the specified EntitlementEvent message. Does not implicitly {@link google.cloud.channel.v1.EntitlementEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {google.cloud.channel.v1.IEntitlementEvent} message EntitlementEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntitlementEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entitlement != null && Object.hasOwnProperty.call(message, "entitlement")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entitlement); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.eventType); + return writer; + }; + + /** + * Encodes the specified EntitlementEvent message, length delimited. Does not implicitly {@link google.cloud.channel.v1.EntitlementEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {google.cloud.channel.v1.IEntitlementEvent} message EntitlementEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntitlementEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntitlementEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.EntitlementEvent} EntitlementEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntitlementEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.EntitlementEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entitlement = reader.string(); + break; + } + case 2: { + message.eventType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntitlementEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.EntitlementEvent} EntitlementEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntitlementEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntitlementEvent message. + * @function verify + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntitlementEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + if (!$util.isString(message.entitlement)) + return "entitlement: string expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + return null; + }; + + /** + * Creates an EntitlementEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.EntitlementEvent} EntitlementEvent + */ + EntitlementEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.EntitlementEvent) + return object; + var message = new $root.google.cloud.channel.v1.EntitlementEvent(); + if (object.entitlement != null) + message.entitlement = String(object.entitlement); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "CREATED": + case 1: + message.eventType = 1; + break; + case "PRICE_PLAN_SWITCHED": + case 3: + message.eventType = 3; + break; + case "COMMITMENT_CHANGED": + case 4: + message.eventType = 4; + break; + case "RENEWED": + case 5: + message.eventType = 5; + break; + case "SUSPENDED": + case 6: + message.eventType = 6; + break; + case "ACTIVATED": + case 7: + message.eventType = 7; + break; + case "CANCELLED": + case 8: + message.eventType = 8; + break; + case "SKU_CHANGED": + case 9: + message.eventType = 9; + break; + case "RENEWAL_SETTING_CHANGED": + case 10: + message.eventType = 10; + break; + case "PAID_SERVICE_STARTED": + case 11: + message.eventType = 11; + break; + case "LICENSE_ASSIGNMENT_CHANGED": + case 12: + message.eventType = 12; + break; + case "LICENSE_CAP_CHANGED": + case 13: + message.eventType = 13; + break; + } + return message; + }; + + /** + * Creates a plain object from an EntitlementEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {google.cloud.channel.v1.EntitlementEvent} message EntitlementEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntitlementEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entitlement = ""; + object.eventType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.entitlement != null && message.hasOwnProperty("entitlement")) + object.entitlement = message.entitlement; + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.channel.v1.EntitlementEvent.Type[message.eventType] === undefined ? message.eventType : $root.google.cloud.channel.v1.EntitlementEvent.Type[message.eventType] : message.eventType; + return object; + }; + + /** + * Converts this EntitlementEvent to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.EntitlementEvent + * @instance + * @returns {Object.} JSON object + */ + EntitlementEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntitlementEvent + * @function getTypeUrl + * @memberof google.cloud.channel.v1.EntitlementEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntitlementEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.EntitlementEvent"; + }; + + /** + * Type enum. + * @name google.cloud.channel.v1.EntitlementEvent.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CREATED=1 CREATED value + * @property {number} PRICE_PLAN_SWITCHED=3 PRICE_PLAN_SWITCHED value + * @property {number} COMMITMENT_CHANGED=4 COMMITMENT_CHANGED value + * @property {number} RENEWED=5 RENEWED value + * @property {number} SUSPENDED=6 SUSPENDED value + * @property {number} ACTIVATED=7 ACTIVATED value + * @property {number} CANCELLED=8 CANCELLED value + * @property {number} SKU_CHANGED=9 SKU_CHANGED value + * @property {number} RENEWAL_SETTING_CHANGED=10 RENEWAL_SETTING_CHANGED value + * @property {number} PAID_SERVICE_STARTED=11 PAID_SERVICE_STARTED value + * @property {number} LICENSE_ASSIGNMENT_CHANGED=12 LICENSE_ASSIGNMENT_CHANGED value + * @property {number} LICENSE_CAP_CHANGED=13 LICENSE_CAP_CHANGED value + */ + EntitlementEvent.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATED"] = 1; + values[valuesById[3] = "PRICE_PLAN_SWITCHED"] = 3; + values[valuesById[4] = "COMMITMENT_CHANGED"] = 4; + values[valuesById[5] = "RENEWED"] = 5; + values[valuesById[6] = "SUSPENDED"] = 6; + values[valuesById[7] = "ACTIVATED"] = 7; + values[valuesById[8] = "CANCELLED"] = 8; + values[valuesById[9] = "SKU_CHANGED"] = 9; + values[valuesById[10] = "RENEWAL_SETTING_CHANGED"] = 10; + values[valuesById[11] = "PAID_SERVICE_STARTED"] = 11; + values[valuesById[12] = "LICENSE_ASSIGNMENT_CHANGED"] = 12; + values[valuesById[13] = "LICENSE_CAP_CHANGED"] = 13; + return values; + })(); + + return EntitlementEvent; + })(); + + v1.SubscriberEvent = (function() { + + /** + * Properties of a SubscriberEvent. + * @memberof google.cloud.channel.v1 + * @interface ISubscriberEvent + * @property {google.cloud.channel.v1.ICustomerEvent|null} [customerEvent] SubscriberEvent customerEvent + * @property {google.cloud.channel.v1.IEntitlementEvent|null} [entitlementEvent] SubscriberEvent entitlementEvent + */ + + /** + * Constructs a new SubscriberEvent. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a SubscriberEvent. + * @implements ISubscriberEvent + * @constructor + * @param {google.cloud.channel.v1.ISubscriberEvent=} [properties] Properties to set + */ + function SubscriberEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriberEvent customerEvent. + * @member {google.cloud.channel.v1.ICustomerEvent|null|undefined} customerEvent + * @memberof google.cloud.channel.v1.SubscriberEvent + * @instance + */ + SubscriberEvent.prototype.customerEvent = null; + + /** + * SubscriberEvent entitlementEvent. + * @member {google.cloud.channel.v1.IEntitlementEvent|null|undefined} entitlementEvent + * @memberof google.cloud.channel.v1.SubscriberEvent + * @instance + */ + SubscriberEvent.prototype.entitlementEvent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubscriberEvent event. + * @member {"customerEvent"|"entitlementEvent"|undefined} event + * @memberof google.cloud.channel.v1.SubscriberEvent + * @instance + */ + Object.defineProperty(SubscriberEvent.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["customerEvent", "entitlementEvent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubscriberEvent instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {google.cloud.channel.v1.ISubscriberEvent=} [properties] Properties to set + * @returns {google.cloud.channel.v1.SubscriberEvent} SubscriberEvent instance + */ + SubscriberEvent.create = function create(properties) { + return new SubscriberEvent(properties); + }; + + /** + * Encodes the specified SubscriberEvent message. Does not implicitly {@link google.cloud.channel.v1.SubscriberEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {google.cloud.channel.v1.ISubscriberEvent} message SubscriberEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerEvent != null && Object.hasOwnProperty.call(message, "customerEvent")) + $root.google.cloud.channel.v1.CustomerEvent.encode(message.customerEvent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entitlementEvent != null && Object.hasOwnProperty.call(message, "entitlementEvent")) + $root.google.cloud.channel.v1.EntitlementEvent.encode(message.entitlementEvent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscriberEvent message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SubscriberEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {google.cloud.channel.v1.ISubscriberEvent} message SubscriberEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriberEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriberEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.SubscriberEvent} SubscriberEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.SubscriberEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customerEvent = $root.google.cloud.channel.v1.CustomerEvent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.entitlementEvent = $root.google.cloud.channel.v1.EntitlementEvent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriberEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.SubscriberEvent} SubscriberEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriberEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriberEvent message. + * @function verify + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriberEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.customerEvent != null && message.hasOwnProperty("customerEvent")) { + properties.event = 1; + { + var error = $root.google.cloud.channel.v1.CustomerEvent.verify(message.customerEvent); + if (error) + return "customerEvent." + error; + } + } + if (message.entitlementEvent != null && message.hasOwnProperty("entitlementEvent")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.google.cloud.channel.v1.EntitlementEvent.verify(message.entitlementEvent); + if (error) + return "entitlementEvent." + error; + } + } + return null; + }; + + /** + * Creates a SubscriberEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.SubscriberEvent} SubscriberEvent + */ + SubscriberEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.SubscriberEvent) + return object; + var message = new $root.google.cloud.channel.v1.SubscriberEvent(); + if (object.customerEvent != null) { + if (typeof object.customerEvent !== "object") + throw TypeError(".google.cloud.channel.v1.SubscriberEvent.customerEvent: object expected"); + message.customerEvent = $root.google.cloud.channel.v1.CustomerEvent.fromObject(object.customerEvent); + } + if (object.entitlementEvent != null) { + if (typeof object.entitlementEvent !== "object") + throw TypeError(".google.cloud.channel.v1.SubscriberEvent.entitlementEvent: object expected"); + message.entitlementEvent = $root.google.cloud.channel.v1.EntitlementEvent.fromObject(object.entitlementEvent); + } + return message; + }; + + /** + * Creates a plain object from a SubscriberEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {google.cloud.channel.v1.SubscriberEvent} message SubscriberEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriberEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.customerEvent != null && message.hasOwnProperty("customerEvent")) { + object.customerEvent = $root.google.cloud.channel.v1.CustomerEvent.toObject(message.customerEvent, options); + if (options.oneofs) + object.event = "customerEvent"; + } + if (message.entitlementEvent != null && message.hasOwnProperty("entitlementEvent")) { + object.entitlementEvent = $root.google.cloud.channel.v1.EntitlementEvent.toObject(message.entitlementEvent, options); + if (options.oneofs) + object.event = "entitlementEvent"; + } + return object; + }; + + /** + * Converts this SubscriberEvent to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.SubscriberEvent + * @instance + * @returns {Object.} JSON object + */ + SubscriberEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriberEvent + * @function getTypeUrl + * @memberof google.cloud.channel.v1.SubscriberEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriberEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.SubscriberEvent"; + }; + + return SubscriberEvent; + })(); + + return v1; + })(); + + return channel; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.PostalAddress = (function() { + + /** + * Properties of a PostalAddress. + * @memberof google.type + * @interface IPostalAddress + * @property {number|null} [revision] PostalAddress revision + * @property {string|null} [regionCode] PostalAddress regionCode + * @property {string|null} [languageCode] PostalAddress languageCode + * @property {string|null} [postalCode] PostalAddress postalCode + * @property {string|null} [sortingCode] PostalAddress sortingCode + * @property {string|null} [administrativeArea] PostalAddress administrativeArea + * @property {string|null} [locality] PostalAddress locality + * @property {string|null} [sublocality] PostalAddress sublocality + * @property {Array.|null} [addressLines] PostalAddress addressLines + * @property {Array.|null} [recipients] PostalAddress recipients + * @property {string|null} [organization] PostalAddress organization + */ + + /** + * Constructs a new PostalAddress. + * @memberof google.type + * @classdesc Represents a PostalAddress. + * @implements IPostalAddress + * @constructor + * @param {google.type.IPostalAddress=} [properties] Properties to set + */ + function PostalAddress(properties) { + this.addressLines = []; + this.recipients = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PostalAddress revision. + * @member {number} revision + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.revision = 0; + + /** + * PostalAddress regionCode. + * @member {string} regionCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.regionCode = ""; + + /** + * PostalAddress languageCode. + * @member {string} languageCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.languageCode = ""; + + /** + * PostalAddress postalCode. + * @member {string} postalCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.postalCode = ""; + + /** + * PostalAddress sortingCode. + * @member {string} sortingCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sortingCode = ""; + + /** + * PostalAddress administrativeArea. + * @member {string} administrativeArea + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.administrativeArea = ""; + + /** + * PostalAddress locality. + * @member {string} locality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.locality = ""; + + /** + * PostalAddress sublocality. + * @member {string} sublocality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sublocality = ""; + + /** + * PostalAddress addressLines. + * @member {Array.} addressLines + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.addressLines = $util.emptyArray; + + /** + * PostalAddress recipients. + * @member {Array.} recipients + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.recipients = $util.emptyArray; + + /** + * PostalAddress organization. + * @member {string} organization + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.organization = ""; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @function create + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress=} [properties] Properties to set + * @returns {google.type.PostalAddress} PostalAddress instance + */ + PostalAddress.create = function create(properties) { + return new PostalAddress(properties); + }; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encode + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); + if (message.sortingCode != null && Object.hasOwnProperty.call(message, "sortingCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sortingCode); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.administrativeArea); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locality); + if (message.sublocality != null && Object.hasOwnProperty.call(message, "sublocality")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sublocality); + if (message.addressLines != null && message.addressLines.length) + for (var i = 0; i < message.addressLines.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.addressLines[i]); + if (message.recipients != null && message.recipients.length) + for (var i = 0; i < message.recipients.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recipients[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.organization); + return writer; + }; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @function decode + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.PostalAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.revision = reader.int32(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 4: { + message.postalCode = reader.string(); + break; + } + case 5: { + message.sortingCode = reader.string(); + break; + } + case 6: { + message.administrativeArea = reader.string(); + break; + } + case 7: { + message.locality = reader.string(); + break; + } + case 8: { + message.sublocality = reader.string(); + break; + } + case 9: { + if (!(message.addressLines && message.addressLines.length)) + message.addressLines = []; + message.addressLines.push(reader.string()); + break; + } + case 10: { + if (!(message.recipients && message.recipients.length)) + message.recipients = []; + message.recipients.push(reader.string()); + break; + } + case 11: { + message.organization = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostalAddress message. + * @function verify + * @memberof google.type.PostalAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostalAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision)) + return "revision: integer expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + if (!$util.isString(message.sortingCode)) + return "sortingCode: string expected"; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + if (!$util.isString(message.sublocality)) + return "sublocality: string expected"; + if (message.addressLines != null && message.hasOwnProperty("addressLines")) { + if (!Array.isArray(message.addressLines)) + return "addressLines: array expected"; + for (var i = 0; i < message.addressLines.length; ++i) + if (!$util.isString(message.addressLines[i])) + return "addressLines: string[] expected"; + } + if (message.recipients != null && message.hasOwnProperty("recipients")) { + if (!Array.isArray(message.recipients)) + return "recipients: array expected"; + for (var i = 0; i < message.recipients.length; ++i) + if (!$util.isString(message.recipients[i])) + return "recipients: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + return null; + }; + + /** + * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.PostalAddress + * @static + * @param {Object.} object Plain object + * @returns {google.type.PostalAddress} PostalAddress + */ + PostalAddress.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.PostalAddress) + return object; + var message = new $root.google.type.PostalAddress(); + if (object.revision != null) + message.revision = object.revision | 0; + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + if (object.sortingCode != null) + message.sortingCode = String(object.sortingCode); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.locality != null) + message.locality = String(object.locality); + if (object.sublocality != null) + message.sublocality = String(object.sublocality); + if (object.addressLines) { + if (!Array.isArray(object.addressLines)) + throw TypeError(".google.type.PostalAddress.addressLines: array expected"); + message.addressLines = []; + for (var i = 0; i < object.addressLines.length; ++i) + message.addressLines[i] = String(object.addressLines[i]); + } + if (object.recipients) { + if (!Array.isArray(object.recipients)) + throw TypeError(".google.type.PostalAddress.recipients: array expected"); + message.recipients = []; + for (var i = 0; i < object.recipients.length; ++i) + message.recipients[i] = String(object.recipients[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.PostalAddress + * @static + * @param {google.type.PostalAddress} message PostalAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostalAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.addressLines = []; + object.recipients = []; + } + if (options.defaults) { + object.revision = 0; + object.regionCode = ""; + object.languageCode = ""; + object.postalCode = ""; + object.sortingCode = ""; + object.administrativeArea = ""; + object.locality = ""; + object.sublocality = ""; + object.organization = ""; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + object.sortingCode = message.sortingCode; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + object.administrativeArea = message.administrativeArea; + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + object.sublocality = message.sublocality; + if (message.addressLines && message.addressLines.length) { + object.addressLines = []; + for (var j = 0; j < message.addressLines.length; ++j) + object.addressLines[j] = message.addressLines[j]; + } + if (message.recipients && message.recipients.length) { + object.recipients = []; + for (var j = 0; j < message.recipients.length; ++j) + object.recipients[j] = message.recipients[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this PostalAddress to JSON. + * @function toJSON + * @memberof google.type.PostalAddress + * @instance + * @returns {Object.} JSON object + */ + PostalAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostalAddress + * @function getTypeUrl + * @memberof google.type.PostalAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostalAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.PostalAddress"; + }; + + return PostalAddress; + })(); + + type.Money = (function() { + + /** + * Properties of a Money. + * @memberof google.type + * @interface IMoney + * @property {string|null} [currencyCode] Money currencyCode + * @property {number|Long|null} [units] Money units + * @property {number|null} [nanos] Money nanos + */ + + /** + * Constructs a new Money. + * @memberof google.type + * @classdesc Represents a Money. + * @implements IMoney + * @constructor + * @param {google.type.IMoney=} [properties] Properties to set + */ + function Money(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Money currencyCode. + * @member {string} currencyCode + * @memberof google.type.Money + * @instance + */ + Money.prototype.currencyCode = ""; + + /** + * Money units. + * @member {number|Long} units + * @memberof google.type.Money + * @instance + */ + Money.prototype.units = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Money nanos. + * @member {number} nanos + * @memberof google.type.Money + * @instance + */ + Money.prototype.nanos = 0; + + /** + * Creates a new Money instance using the specified properties. + * @function create + * @memberof google.type.Money + * @static + * @param {google.type.IMoney=} [properties] Properties to set + * @returns {google.type.Money} Money instance + */ + Money.create = function create(properties) { + return new Money(properties); + }; + + /** + * Encodes the specified Money message. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encode + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.units != null && Object.hasOwnProperty.call(message, "units")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.units); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link google.type.Money.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Money + * @static + * @param {google.type.IMoney} message Money message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Money.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Money message from the specified reader or buffer. + * @function decode + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Money(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.currencyCode = reader.string(); + break; + } + case 2: { + message.units = reader.int64(); + break; + } + case 3: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Money + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Money} Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Money.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Money message. + * @function verify + * @memberof google.type.Money + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Money.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.units != null && message.hasOwnProperty("units")) + if (!$util.isInteger(message.units) && !(message.units && $util.isInteger(message.units.low) && $util.isInteger(message.units.high))) + return "units: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Money + * @static + * @param {Object.} object Plain object + * @returns {google.type.Money} Money + */ + Money.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Money) + return object; + var message = new $root.google.type.Money(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.units != null) + if ($util.Long) + (message.units = $util.Long.fromValue(object.units)).unsigned = false; + else if (typeof object.units === "string") + message.units = parseInt(object.units, 10); + else if (typeof object.units === "number") + message.units = object.units; + else if (typeof object.units === "object") + message.units = new $util.LongBits(object.units.low >>> 0, object.units.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Money + * @static + * @param {google.type.Money} message Money + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Money.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.units = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.units = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.units != null && message.hasOwnProperty("units")) + if (typeof message.units === "number") + object.units = options.longs === String ? String(message.units) : message.units; + else + object.units = options.longs === String ? $util.Long.prototype.toString.call(message.units) : options.longs === Number ? new $util.LongBits(message.units.low >>> 0, message.units.high >>> 0).toNumber() : message.units; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Money to JSON. + * @function toJSON + * @memberof google.type.Money + * @instance + * @returns {Object.} JSON object + */ + Money.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Money + * @function getTypeUrl + * @memberof google.type.Money + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Money.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Money"; + }; + + return Money; + })(); + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + type.DateTime = (function() { + + /** + * Properties of a DateTime. + * @memberof google.type + * @interface IDateTime + * @property {number|null} [year] DateTime year + * @property {number|null} [month] DateTime month + * @property {number|null} [day] DateTime day + * @property {number|null} [hours] DateTime hours + * @property {number|null} [minutes] DateTime minutes + * @property {number|null} [seconds] DateTime seconds + * @property {number|null} [nanos] DateTime nanos + * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset + * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone + */ + + /** + * Constructs a new DateTime. + * @memberof google.type + * @classdesc Represents a DateTime. + * @implements IDateTime + * @constructor + * @param {google.type.IDateTime=} [properties] Properties to set + */ + function DateTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DateTime year. + * @member {number} year + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.year = 0; + + /** + * DateTime month. + * @member {number} month + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.month = 0; + + /** + * DateTime day. + * @member {number} day + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.day = 0; + + /** + * DateTime hours. + * @member {number} hours + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.hours = 0; + + /** + * DateTime minutes. + * @member {number} minutes + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.minutes = 0; + + /** + * DateTime seconds. + * @member {number} seconds + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.seconds = 0; + + /** + * DateTime nanos. + * @member {number} nanos + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.nanos = 0; + + /** + * DateTime utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.utcOffset = null; + + /** + * DateTime timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DateTime timeOffset. + * @member {"utcOffset"|"timeZone"|undefined} timeOffset + * @memberof google.type.DateTime + * @instance + */ + Object.defineProperty(DateTime.prototype, "timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DateTime instance using the specified properties. + * @function create + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime=} [properties] Properties to set + * @returns {google.type.DateTime} DateTime instance + */ + DateTime.create = function create(properties) { + return new DateTime(properties); + }; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encode + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @function decode + * @memberof google.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.DateTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + case 4: { + message.hours = reader.int32(); + break; + } + case 5: { + message.minutes = reader.int32(); + break; + } + case 6: { + message.seconds = reader.int32(); + break; + } + case 7: { + message.nanos = reader.int32(); + break; + } + case 8: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTime message. + * @function verify + * @memberof google.type.DateTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + properties.timeOffset = 1; + { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + if (properties.timeOffset === 1) + return "timeOffset: multiple values"; + properties.timeOffset = 1; + { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + } + return null; + }; + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.DateTime + * @static + * @param {Object.} object Plain object + * @returns {google.type.DateTime} DateTime + */ + DateTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.DateTime) + return object; + var message = new $root.google.type.DateTime(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.type.DateTime.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.type.DateTime.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + return message; + }; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.DateTime + * @static + * @param {google.type.DateTime} message DateTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (options.oneofs) + object.timeOffset = "utcOffset"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (options.oneofs) + object.timeOffset = "timeZone"; + } + return object; + }; + + /** + * Converts this DateTime to JSON. + * @function toJSON + * @memberof google.type.DateTime + * @instance + * @returns {Object.} JSON object + */ + DateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTime + * @function getTypeUrl + * @memberof google.type.DateTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.DateTime"; + }; + + return DateTime; + })(); + + type.TimeZone = (function() { + + /** + * Properties of a TimeZone. + * @memberof google.type + * @interface ITimeZone + * @property {string|null} [id] TimeZone id + * @property {string|null} [version] TimeZone version + */ + + /** + * Constructs a new TimeZone. + * @memberof google.type + * @classdesc Represents a TimeZone. + * @implements ITimeZone + * @constructor + * @param {google.type.ITimeZone=} [properties] Properties to set + */ + function TimeZone(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeZone id. + * @member {string} id + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.id = ""; + + /** + * TimeZone version. + * @member {string} version + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.version = ""; + + /** + * Creates a new TimeZone instance using the specified properties. + * @function create + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone=} [properties] Properties to set + * @returns {google.type.TimeZone} TimeZone instance + */ + TimeZone.create = function create(properties) { + return new TimeZone(properties); + }; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encode + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZone message. + * @function verify + * @memberof google.type.TimeZone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZone.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeZone + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeZone} TimeZone + */ + TimeZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeZone) + return object; + var message = new $root.google.type.TimeZone(); + if (object.id != null) + message.id = String(object.id); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeZone + * @static + * @param {google.type.TimeZone} message TimeZone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.version = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this TimeZone to JSON. + * @function toJSON + * @memberof google.type.TimeZone + * @instance + * @returns {Object.} JSON object + */ + TimeZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZone + * @function getTypeUrl + * @memberof google.type.TimeZone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeZone"; + }; + + return TimeZone; + })(); + + type.Decimal = (function() { + + /** + * Properties of a Decimal. + * @memberof google.type + * @interface IDecimal + * @property {string|null} [value] Decimal value + */ + + /** + * Constructs a new Decimal. + * @memberof google.type + * @classdesc Represents a Decimal. + * @implements IDecimal + * @constructor + * @param {google.type.IDecimal=} [properties] Properties to set + */ + function Decimal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Decimal value. + * @member {string} value + * @memberof google.type.Decimal + * @instance + */ + Decimal.prototype.value = ""; + + /** + * Creates a new Decimal instance using the specified properties. + * @function create + * @memberof google.type.Decimal + * @static + * @param {google.type.IDecimal=} [properties] Properties to set + * @returns {google.type.Decimal} Decimal instance + */ + Decimal.create = function create(properties) { + return new Decimal(properties); + }; + + /** + * Encodes the specified Decimal message. Does not implicitly {@link google.type.Decimal.verify|verify} messages. + * @function encode + * @memberof google.type.Decimal + * @static + * @param {google.type.IDecimal} message Decimal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Decimal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified Decimal message, length delimited. Does not implicitly {@link google.type.Decimal.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Decimal + * @static + * @param {google.type.IDecimal} message Decimal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Decimal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Decimal message from the specified reader or buffer. + * @function decode + * @memberof google.type.Decimal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Decimal} Decimal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Decimal.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Decimal(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Decimal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Decimal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Decimal} Decimal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Decimal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Decimal message. + * @function verify + * @memberof google.type.Decimal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Decimal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a Decimal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Decimal + * @static + * @param {Object.} object Plain object + * @returns {google.type.Decimal} Decimal + */ + Decimal.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Decimal) + return object; + var message = new $root.google.type.Decimal(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a Decimal message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Decimal + * @static + * @param {google.type.Decimal} message Decimal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Decimal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Decimal to JSON. + * @function toJSON + * @memberof google.type.Decimal + * @instance + * @returns {Object.} JSON object + */ + Decimal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Decimal + * @function getTypeUrl + * @memberof google.type.Decimal + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Decimal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Decimal"; + }; + + return Decimal; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-channel/protos/protos.json b/packages/google-cloud-channel/protos/protos.json new file mode 100644 index 00000000000..010e18ce203 --- /dev/null +++ b/packages/google-cloud-channel/protos/protos.json @@ -0,0 +1,5525 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "channel": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/channel/v1;channel", + "java_multiple_files": true, + "java_outer_classname": "SubscriberEventProto", + "java_package": "com.google.cloud.channel.v1" + }, + "nested": { + "ChannelPartnerLinkView": { + "values": { + "UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "ChannelPartnerLinkState": { + "values": { + "CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED": 0, + "INVITED": 1, + "ACTIVE": 2, + "REVOKED": 3, + "SUSPENDED": 4 + } + }, + "ChannelPartnerLink": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/ChannelPartnerLink", + "(google.api.resource).pattern": "accounts/{account}/channelPartnerLinks/{channel_partner_link}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resellerCloudIdentityId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "linkState": { + "type": "ChannelPartnerLinkState", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "inviteLinkUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "channelPartnerCloudIdentityInfo": { + "type": "CloudIdentityInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EduData": { + "fields": { + "instituteType": { + "type": "InstituteType", + "id": 1 + }, + "instituteSize": { + "type": "InstituteSize", + "id": 2 + }, + "website": { + "type": "string", + "id": 3 + } + }, + "nested": { + "InstituteType": { + "values": { + "INSTITUTE_TYPE_UNSPECIFIED": 0, + "K12": 1, + "UNIVERSITY": 2 + } + }, + "InstituteSize": { + "values": { + "INSTITUTE_SIZE_UNSPECIFIED": 0, + "SIZE_1_100": 1, + "SIZE_101_500": 2, + "SIZE_501_1000": 3, + "SIZE_1001_2000": 4, + "SIZE_2001_5000": 5, + "SIZE_5001_10000": 6, + "SIZE_10001_OR_MORE": 7 + } + } + } + }, + "CloudIdentityInfo": { + "fields": { + "customerType": { + "type": "CustomerType", + "id": 1 + }, + "primaryDomain": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "isDomainVerified": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "alternateEmail": { + "type": "string", + "id": 6 + }, + "phoneNumber": { + "type": "string", + "id": 7 + }, + "languageCode": { + "type": "string", + "id": 8 + }, + "adminConsoleUri": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "eduData": { + "type": "EduData", + "id": 22 + } + }, + "nested": { + "CustomerType": { + "values": { + "CUSTOMER_TYPE_UNSPECIFIED": 0, + "DOMAIN": 1, + "TEAM": 2 + } + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "int64Value", + "stringValue", + "doubleValue", + "protoValue", + "boolValue" + ] + } + }, + "fields": { + "int64Value": { + "type": "int64", + "id": 1 + }, + "stringValue": { + "type": "string", + "id": 2 + }, + "doubleValue": { + "type": "double", + "id": 3 + }, + "protoValue": { + "type": "google.protobuf.Any", + "id": 4 + }, + "boolValue": { + "type": "bool", + "id": 5 + } + } + }, + "AdminUser": { + "fields": { + "email": { + "type": "string", + "id": 1 + }, + "givenName": { + "type": "string", + "id": 2 + }, + "familyName": { + "type": "string", + "id": 3 + } + } + }, + "Customer": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/Customer", + "(google.api.resource).pattern": "accounts/{account}/customers/{customer}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "orgDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "orgPostalAddress": { + "type": "google.type.PostalAddress", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "primaryContactInfo": { + "type": "ContactInfo", + "id": 4 + }, + "alternateEmail": { + "type": "string", + "id": 5 + }, + "domain": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudIdentityId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "languageCode": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudIdentityInfo": { + "type": "CloudIdentityInfo", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "channelPartnerId": { + "type": "string", + "id": 13 + } + } + }, + "ContactInfo": { + "fields": { + "firstName": { + "type": "string", + "id": 1 + }, + "lastName": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "email": { + "type": "string", + "id": 5 + }, + "title": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "phone": { + "type": "string", + "id": 7 + } + } + }, + "Entitlement": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/Entitlement", + "(google.api.resource).pattern": "accounts/{account}/customers/{customer}/entitlements/{entitlement}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "offer": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Offer" + } + }, + "commitmentSettings": { + "type": "CommitmentSettings", + "id": 12 + }, + "provisioningState": { + "type": "ProvisioningState", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "provisionedService": { + "type": "ProvisionedService", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "suspensionReasons": { + "rule": "repeated", + "type": "SuspensionReason", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "purchaseOrderId": { + "type": "string", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trialSettings": { + "type": "TrialSettings", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "associationInfo": { + "type": "AssociationInfo", + "id": 23 + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 26 + } + }, + "nested": { + "ProvisioningState": { + "values": { + "PROVISIONING_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "SUSPENDED": 5 + } + }, + "SuspensionReason": { + "values": { + "SUSPENSION_REASON_UNSPECIFIED": 0, + "RESELLER_INITIATED": 1, + "TRIAL_ENDED": 2, + "RENEWAL_WITH_TYPE_CANCEL": 3, + "PENDING_TOS_ACCEPTANCE": 4, + "OTHER": 100 + } + } + } + }, + "Parameter": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "Value", + "id": 2 + }, + "editable": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AssociationInfo": { + "fields": { + "baseEntitlement": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Entitlement" + } + } + } + }, + "ProvisionedService": { + "fields": { + "provisioningId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "productId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "skuId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CommitmentSettings": { + "fields": { + "startTime": { + "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" + } + }, + "renewalSettings": { + "type": "RenewalSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RenewalSettings": { + "fields": { + "enableRenewal": { + "type": "bool", + "id": 1 + }, + "resizeUnitCount": { + "type": "bool", + "id": 2 + }, + "paymentPlan": { + "type": "PaymentPlan", + "id": 5 + }, + "paymentCycle": { + "type": "Period", + "id": 6 + } + } + }, + "TrialSettings": { + "fields": { + "trial": { + "type": "bool", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "TransferableSku": { + "fields": { + "transferEligibility": { + "type": "TransferEligibility", + "id": 9 + }, + "sku": { + "type": "Sku", + "id": 11 + }, + "legacySku": { + "type": "Sku", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TransferEligibility": { + "fields": { + "isEligible": { + "type": "bool", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "ineligibilityReason": { + "type": "Reason", + "id": 3 + } + }, + "nested": { + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "PENDING_TOS_ACCEPTANCE": 1, + "SKU_NOT_ELIGIBLE": 2, + "SKU_SUSPENDED": 3 + } + } + } + }, + "PromotionalOrderType": { + "values": { + "PROMOTIONAL_TYPE_UNSPECIFIED": 0, + "NEW_UPGRADE": 1, + "TRANSFER": 2, + "PROMOTION_SWITCH": 3 + } + }, + "PaymentPlan": { + "values": { + "PAYMENT_PLAN_UNSPECIFIED": 0, + "COMMITMENT": 1, + "FLEXIBLE": 2, + "FREE": 3, + "TRIAL": 4, + "OFFLINE": 5 + } + }, + "PaymentType": { + "values": { + "PAYMENT_TYPE_UNSPECIFIED": 0, + "PREPAY": 1, + "POSTPAY": 2 + } + }, + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "SEAT": 1, + "MAU": 2, + "GB": 3, + "LICENSED_USER": 4, + "MINUTES": 5, + "IAAS_USAGE": 6, + "SUBSCRIPTION": 7 + } + }, + "PeriodType": { + "values": { + "PERIOD_TYPE_UNSPECIFIED": 0, + "DAY": 1, + "MONTH": 2, + "YEAR": 3 + } + }, + "Offer": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/Offer", + "(google.api.resource).pattern": "accounts/{account}/offers/{offer}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marketingInfo": { + "type": "MarketingInfo", + "id": 2 + }, + "sku": { + "type": "Sku", + "id": 3 + }, + "plan": { + "type": "Plan", + "id": 4 + }, + "constraints": { + "type": "Constraints", + "id": 5 + }, + "priceByResources": { + "rule": "repeated", + "type": "PriceByResource", + "id": 6 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parameterDefinitions": { + "rule": "repeated", + "type": "ParameterDefinition", + "id": 9 + }, + "dealCode": { + "type": "string", + "id": 12 + } + } + }, + "ParameterDefinition": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parameterType": { + "type": "ParameterType", + "id": 2 + }, + "minValue": { + "type": "Value", + "id": 3 + }, + "maxValue": { + "type": "Value", + "id": 4 + }, + "allowedValues": { + "rule": "repeated", + "type": "Value", + "id": 5 + }, + "optional": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "ParameterType": { + "values": { + "PARAMETER_TYPE_UNSPECIFIED": 0, + "INT64": 1, + "STRING": 2, + "DOUBLE": 3 + } + } + } + }, + "Constraints": { + "fields": { + "customerConstraints": { + "type": "CustomerConstraints", + "id": 1 + } + } + }, + "CustomerConstraints": { + "fields": { + "allowedRegions": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "allowedCustomerTypes": { + "rule": "repeated", + "type": "CloudIdentityInfo.CustomerType", + "id": 2 + }, + "promotionalOrderTypes": { + "rule": "repeated", + "type": "PromotionalOrderType", + "id": 3 + } + } + }, + "Plan": { + "fields": { + "paymentPlan": { + "type": "PaymentPlan", + "id": 1 + }, + "paymentType": { + "type": "PaymentType", + "id": 2 + }, + "paymentCycle": { + "type": "Period", + "id": 3 + }, + "trialPeriod": { + "type": "Period", + "id": 4 + }, + "billingAccount": { + "type": "string", + "id": 5 + } + } + }, + "PriceByResource": { + "fields": { + "resourceType": { + "type": "ResourceType", + "id": 1 + }, + "price": { + "type": "Price", + "id": 2 + }, + "pricePhases": { + "rule": "repeated", + "type": "PricePhase", + "id": 3 + } + } + }, + "Price": { + "fields": { + "basePrice": { + "type": "google.type.Money", + "id": 1 + }, + "discount": { + "type": "double", + "id": 2 + }, + "effectivePrice": { + "type": "google.type.Money", + "id": 3 + }, + "externalPriceUri": { + "type": "string", + "id": 4 + } + } + }, + "PricePhase": { + "fields": { + "periodType": { + "type": "PeriodType", + "id": 1 + }, + "firstPeriod": { + "type": "int32", + "id": 2 + }, + "lastPeriod": { + "type": "int32", + "id": 3 + }, + "price": { + "type": "Price", + "id": 4 + }, + "priceTiers": { + "rule": "repeated", + "type": "PriceTier", + "id": 5 + } + } + }, + "PriceTier": { + "fields": { + "firstResource": { + "type": "int32", + "id": 1 + }, + "lastResource": { + "type": "int32", + "id": 2 + }, + "price": { + "type": "Price", + "id": 3 + } + } + }, + "Period": { + "fields": { + "duration": { + "type": "int32", + "id": 1 + }, + "periodType": { + "type": "PeriodType", + "id": 2 + } + } + }, + "MediaType": { + "values": { + "MEDIA_TYPE_UNSPECIFIED": 0, + "MEDIA_TYPE_IMAGE": 1 + } + }, + "Product": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/Product", + "(google.api.resource).pattern": "products/{product}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marketingInfo": { + "type": "MarketingInfo", + "id": 2 + } + } + }, + "Sku": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/Sku", + "(google.api.resource).pattern": "products/{product}/skus/{sku}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "marketingInfo": { + "type": "MarketingInfo", + "id": 2 + }, + "product": { + "type": "Product", + "id": 3 + } + } + }, + "MarketingInfo": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "defaultLogo": { + "type": "Media", + "id": 3 + } + } + }, + "Media": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + }, + "type": { + "type": "MediaType", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "operationType": { + "type": "OperationType", + "id": 1 + } + }, + "nested": { + "OperationType": { + "values": { + "OPERATION_TYPE_UNSPECIFIED": 0, + "CREATE_ENTITLEMENT": 1, + "CHANGE_RENEWAL_SETTINGS": 3, + "START_PAID_SERVICE": 5, + "ACTIVATE_ENTITLEMENT": 7, + "SUSPEND_ENTITLEMENT": 8, + "CANCEL_ENTITLEMENT": 9, + "TRANSFER_ENTITLEMENTS": 10, + "TRANSFER_ENTITLEMENTS_TO_GOOGLE": 11, + "CHANGE_OFFER": 14, + "CHANGE_PARAMETERS": 15, + "PROVISION_CLOUD_IDENTITY": 16 + } + } + } + }, + "CloudChannelReportsService": { + "options": { + "(google.api.default_host)": "cloudchannel.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/apps.reports.usage.readonly" + }, + "methods": { + "RunReportJob": { + "requestType": "RunReportJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/reports/*}:run", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "RunReportJobResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/reports/*}:run", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RunReportJobResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FetchReportResults": { + "requestType": "FetchReportResultsRequest", + "responseType": "FetchReportResultsResponse", + "options": { + "(google.api.http).post": "/v1/{report_job=accounts/*/reportJobs/*}:fetchReportResults", + "(google.api.http).body": "*", + "(google.api.method_signature)": "report_job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{report_job=accounts/*/reportJobs/*}:fetchReportResults", + "body": "*" + } + }, + { + "(google.api.method_signature)": "report_job" + } + ] + }, + "ListReports": { + "requestType": "ListReportsRequest", + "responseType": "ListReportsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*}/reports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*}/reports" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "RunReportJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Report" + } + }, + "dateRange": { + "type": "DateRange", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RunReportJobResponse": { + "fields": { + "reportJob": { + "type": "ReportJob", + "id": 1 + }, + "reportMetadata": { + "type": "ReportResultsMetadata", + "id": 2 + } + } + }, + "FetchReportResultsRequest": { + "fields": { + "reportJob": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/ReportJob" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchReportResultsResponse": { + "fields": { + "reportMetadata": { + "type": "ReportResultsMetadata", + "id": 1 + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListReportsResponse": { + "fields": { + "reports": { + "rule": "repeated", + "type": "Report", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ReportJob": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/ReportJob", + "(google.api.resource).pattern": "accounts/{account}/reportJobs/{report_job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reportStatus": { + "type": "ReportStatus", + "id": 2 + } + } + }, + "ReportResultsMetadata": { + "fields": { + "report": { + "type": "Report", + "id": 1 + }, + "rowCount": { + "type": "int64", + "id": 2 + }, + "dateRange": { + "type": "DateRange", + "id": 3 + }, + "precedingDateRange": { + "type": "DateRange", + "id": 4 + } + } + }, + "Column": { + "fields": { + "columnId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + } + }, + "nested": { + "DataType": { + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INT": 2, + "DECIMAL": 3, + "MONEY": 4, + "DATE": 5, + "DATE_TIME": 6 + } + } + } + }, + "DateRange": { + "fields": { + "usageStartDateTime": { + "type": "google.type.DateTime", + "id": 1 + }, + "usageEndDateTime": { + "type": "google.type.DateTime", + "id": 2 + }, + "invoiceStartDate": { + "type": "google.type.Date", + "id": 3 + }, + "invoiceEndDate": { + "type": "google.type.Date", + "id": 4 + } + } + }, + "Row": { + "fields": { + "values": { + "rule": "repeated", + "type": "ReportValue", + "id": 1 + } + } + }, + "ReportValue": { + "oneofs": { + "value": { + "oneof": [ + "stringValue", + "intValue", + "decimalValue", + "moneyValue", + "dateValue", + "dateTimeValue" + ] + } + }, + "fields": { + "stringValue": { + "type": "string", + "id": 1 + }, + "intValue": { + "type": "int64", + "id": 2 + }, + "decimalValue": { + "type": "google.type.Decimal", + "id": 3 + }, + "moneyValue": { + "type": "google.type.Money", + "id": 4 + }, + "dateValue": { + "type": "google.type.Date", + "id": 5 + }, + "dateTimeValue": { + "type": "google.type.DateTime", + "id": 6 + } + } + }, + "ReportStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STARTED": 1, + "WRITING": 2, + "AVAILABLE": 3, + "FAILED": 4 + } + } + } + }, + "Report": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/Report", + "(google.api.resource).pattern": "accounts/{account}/reports/{report}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "columns": { + "rule": "repeated", + "type": "Column", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + } + } + }, + "RebillingBasis": { + "values": { + "REBILLING_BASIS_UNSPECIFIED": 0, + "COST_AT_LIST": 1, + "DIRECT_CUSTOMER_COST": 2 + } + }, + "CustomerRepricingConfig": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/CustomerRepricingConfig", + "(google.api.resource).pattern": "accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "repricingConfig": { + "type": "RepricingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ChannelPartnerRepricingConfig": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig", + "(google.api.resource).pattern": "accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "repricingConfig": { + "type": "RepricingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RepricingConfig": { + "oneofs": { + "granularity": { + "oneof": [ + "entitlementGranularity", + "channelPartnerGranularity" + ] + } + }, + "fields": { + "entitlementGranularity": { + "type": "EntitlementGranularity", + "id": 4 + }, + "channelPartnerGranularity": { + "type": "ChannelPartnerGranularity", + "id": 5 + }, + "effectiveInvoiceMonth": { + "type": "google.type.Date", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "adjustment": { + "type": "RepricingAdjustment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rebillingBasis": { + "type": "RebillingBasis", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "EntitlementGranularity": { + "fields": { + "entitlement": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Entitlement" + } + } + } + }, + "ChannelPartnerGranularity": { + "fields": {} + } + } + }, + "RepricingAdjustment": { + "oneofs": { + "adjustment": { + "oneof": [ + "percentageAdjustment" + ] + } + }, + "fields": { + "percentageAdjustment": { + "type": "PercentageAdjustment", + "id": 2 + } + } + }, + "PercentageAdjustment": { + "fields": { + "percentage": { + "type": "google.type.Decimal", + "id": 2 + } + } + }, + "CloudChannelService": { + "options": { + "(google.api.default_host)": "cloudchannel.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/apps.order" + }, + "methods": { + "ListCustomers": { + "requestType": "ListCustomersRequest", + "responseType": "ListCustomersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*}/customers", + "(google.api.http).additional_bindings.get": "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*}/customers", + "additional_bindings": { + "get": "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers" + } + } + } + ] + }, + "GetCustomer": { + "requestType": "GetCustomerRequest", + "responseType": "Customer", + "options": { + "(google.api.http).get": "/v1/{name=accounts/*/customers/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accounts/*/customers/*}", + "additional_bindings": { + "get": "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CheckCloudIdentityAccountsExist": { + "requestType": "CheckCloudIdentityAccountsExistRequest", + "responseType": "CheckCloudIdentityAccountsExistResponse", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*}:checkCloudIdentityAccountsExist", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*}:checkCloudIdentityAccountsExist", + "body": "*" + } + } + ] + }, + "CreateCustomer": { + "requestType": "CreateCustomerRequest", + "responseType": "Customer", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*}/customers", + "(google.api.http).body": "customer", + "(google.api.http).additional_bindings.post": "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers", + "(google.api.http).additional_bindings.body": "customer" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*}/customers", + "body": "customer", + "additional_bindings": { + "post": "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers", + "body": "customer" + } + } + } + ] + }, + "UpdateCustomer": { + "requestType": "UpdateCustomerRequest", + "responseType": "Customer", + "options": { + "(google.api.http).patch": "/v1/{customer.name=accounts/*/customers/*}", + "(google.api.http).body": "customer", + "(google.api.http).additional_bindings.patch": "/v1/{customer.name=accounts/*/channelPartnerLinks/*/customers/*}", + "(google.api.http).additional_bindings.body": "customer" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{customer.name=accounts/*/customers/*}", + "body": "customer", + "additional_bindings": { + "patch": "/v1/{customer.name=accounts/*/channelPartnerLinks/*/customers/*}", + "body": "customer" + } + } + } + ] + }, + "DeleteCustomer": { + "requestType": "DeleteCustomerRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=accounts/*/customers/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=accounts/*/customers/*}", + "additional_bindings": { + "delete": "/v1/{name=accounts/*/channelPartnerLinks/*/customers/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ImportCustomer": { + "requestType": "ImportCustomerRequest", + "responseType": "Customer", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*}/customers:import", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers:import", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*}/customers:import", + "body": "*", + "additional_bindings": { + "post": "/v1/{parent=accounts/*/channelPartnerLinks/*}/customers:import", + "body": "*" + } + } + } + ] + }, + "ProvisionCloudIdentity": { + "requestType": "ProvisionCloudIdentityRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{customer=accounts/*/customers/*}:provisionCloudIdentity", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Customer", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{customer=accounts/*/customers/*}:provisionCloudIdentity", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Customer", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListEntitlements": { + "requestType": "ListEntitlementsRequest", + "responseType": "ListEntitlementsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*/customers/*}/entitlements" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*/customers/*}/entitlements" + } + } + ] + }, + "ListTransferableSkus": { + "requestType": "ListTransferableSkusRequest", + "responseType": "ListTransferableSkusResponse", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*}:listTransferableSkus", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*}:listTransferableSkus", + "body": "*" + } + } + ] + }, + "ListTransferableOffers": { + "requestType": "ListTransferableOffersRequest", + "responseType": "ListTransferableOffersResponse", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*}:listTransferableOffers", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*}:listTransferableOffers", + "body": "*" + } + } + ] + }, + "GetEntitlement": { + "requestType": "GetEntitlementRequest", + "responseType": "Entitlement", + "options": { + "(google.api.http).get": "/v1/{name=accounts/*/customers/*/entitlements/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accounts/*/customers/*/entitlements/*}" + } + } + ] + }, + "CreateEntitlement": { + "requestType": "CreateEntitlementRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*/customers/*}/entitlements", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*/customers/*}/entitlements", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ChangeParameters": { + "requestType": "ChangeParametersRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:changeParameters", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:changeParameters", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ChangeRenewalSettings": { + "requestType": "ChangeRenewalSettingsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:changeRenewalSettings", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:changeRenewalSettings", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ChangeOffer": { + "requestType": "ChangeOfferRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:changeOffer", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:changeOffer", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StartPaidService": { + "requestType": "StartPaidServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:startPaidService", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:startPaidService", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "SuspendEntitlement": { + "requestType": "SuspendEntitlementRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:suspend", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:suspend", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CancelEntitlement": { + "requestType": "CancelEntitlementRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:cancel", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:cancel", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ActivateEntitlement": { + "requestType": "ActivateEntitlementRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=accounts/*/customers/*/entitlements/*}:activate", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Entitlement", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=accounts/*/customers/*/entitlements/*}:activate", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Entitlement", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "TransferEntitlements": { + "requestType": "TransferEntitlementsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*/customers/*}:transferEntitlements", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "TransferEntitlementsResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*/customers/*}:transferEntitlements", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TransferEntitlementsResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "TransferEntitlementsToGoogle": { + "requestType": "TransferEntitlementsToGoogleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*/customers/*}:transferEntitlementsToGoogle", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*/customers/*}:transferEntitlementsToGoogle", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListChannelPartnerLinks": { + "requestType": "ListChannelPartnerLinksRequest", + "responseType": "ListChannelPartnerLinksResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*}/channelPartnerLinks" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*}/channelPartnerLinks" + } + } + ] + }, + "GetChannelPartnerLink": { + "requestType": "GetChannelPartnerLinkRequest", + "responseType": "ChannelPartnerLink", + "options": { + "(google.api.http).get": "/v1/{name=accounts/*/channelPartnerLinks/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accounts/*/channelPartnerLinks/*}" + } + } + ] + }, + "CreateChannelPartnerLink": { + "requestType": "CreateChannelPartnerLinkRequest", + "responseType": "ChannelPartnerLink", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*}/channelPartnerLinks", + "(google.api.http).body": "channel_partner_link" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*}/channelPartnerLinks", + "body": "channel_partner_link" + } + } + ] + }, + "UpdateChannelPartnerLink": { + "requestType": "UpdateChannelPartnerLinkRequest", + "responseType": "ChannelPartnerLink", + "options": { + "(google.api.http).patch": "/v1/{name=accounts/*/channelPartnerLinks/*}", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{name=accounts/*/channelPartnerLinks/*}", + "body": "*" + } + } + ] + }, + "GetCustomerRepricingConfig": { + "requestType": "GetCustomerRepricingConfigRequest", + "responseType": "CustomerRepricingConfig", + "options": { + "(google.api.http).get": "/v1/{name=accounts/*/customers/*/customerRepricingConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accounts/*/customers/*/customerRepricingConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCustomerRepricingConfigs": { + "requestType": "ListCustomerRepricingConfigsRequest", + "responseType": "ListCustomerRepricingConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateCustomerRepricingConfig": { + "requestType": "CreateCustomerRepricingConfigRequest", + "responseType": "CustomerRepricingConfig", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs", + "(google.api.http).body": "customer_repricing_config", + "(google.api.method_signature)": "parent,customer_repricing_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs", + "body": "customer_repricing_config" + } + }, + { + "(google.api.method_signature)": "parent,customer_repricing_config" + } + ] + }, + "UpdateCustomerRepricingConfig": { + "requestType": "UpdateCustomerRepricingConfigRequest", + "responseType": "CustomerRepricingConfig", + "options": { + "(google.api.http).patch": "/v1/{customer_repricing_config.name=accounts/*/customers/*/customerRepricingConfigs/*}", + "(google.api.http).body": "customer_repricing_config", + "(google.api.method_signature)": "customer_repricing_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{customer_repricing_config.name=accounts/*/customers/*/customerRepricingConfigs/*}", + "body": "customer_repricing_config" + } + }, + { + "(google.api.method_signature)": "customer_repricing_config" + } + ] + }, + "DeleteCustomerRepricingConfig": { + "requestType": "DeleteCustomerRepricingConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=accounts/*/customers/*/customerRepricingConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=accounts/*/customers/*/customerRepricingConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetChannelPartnerRepricingConfig": { + "requestType": "GetChannelPartnerRepricingConfigRequest", + "responseType": "ChannelPartnerRepricingConfig", + "options": { + "(google.api.http).get": "/v1/{name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListChannelPartnerRepricingConfigs": { + "requestType": "ListChannelPartnerRepricingConfigsRequest", + "responseType": "ListChannelPartnerRepricingConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateChannelPartnerRepricingConfig": { + "requestType": "CreateChannelPartnerRepricingConfigRequest", + "responseType": "ChannelPartnerRepricingConfig", + "options": { + "(google.api.http).post": "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs", + "(google.api.http).body": "channel_partner_repricing_config", + "(google.api.method_signature)": "parent,channel_partner_repricing_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs", + "body": "channel_partner_repricing_config" + } + }, + { + "(google.api.method_signature)": "parent,channel_partner_repricing_config" + } + ] + }, + "UpdateChannelPartnerRepricingConfig": { + "requestType": "UpdateChannelPartnerRepricingConfigRequest", + "responseType": "ChannelPartnerRepricingConfig", + "options": { + "(google.api.http).patch": "/v1/{channel_partner_repricing_config.name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}", + "(google.api.http).body": "channel_partner_repricing_config", + "(google.api.method_signature)": "channel_partner_repricing_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{channel_partner_repricing_config.name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}", + "body": "channel_partner_repricing_config" + } + }, + { + "(google.api.method_signature)": "channel_partner_repricing_config" + } + ] + }, + "DeleteChannelPartnerRepricingConfig": { + "requestType": "DeleteChannelPartnerRepricingConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=accounts/*/channelPartnerLinks/*/channelPartnerRepricingConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "LookupOffer": { + "requestType": "LookupOfferRequest", + "responseType": "Offer", + "options": { + "(google.api.http).get": "/v1/{entitlement=accounts/*/customers/*/entitlements/*}:lookupOffer" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{entitlement=accounts/*/customers/*/entitlements/*}:lookupOffer" + } + } + ] + }, + "ListProducts": { + "requestType": "ListProductsRequest", + "responseType": "ListProductsResponse", + "options": { + "(google.api.http).get": "/v1/products" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/products" + } + } + ] + }, + "ListSkus": { + "requestType": "ListSkusRequest", + "responseType": "ListSkusResponse", + "options": { + "(google.api.http).get": "/v1/{parent=products/*}/skus" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=products/*}/skus" + } + } + ] + }, + "ListOffers": { + "requestType": "ListOffersRequest", + "responseType": "ListOffersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=accounts/*}/offers" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=accounts/*}/offers" + } + } + ] + }, + "ListPurchasableSkus": { + "requestType": "ListPurchasableSkusRequest", + "responseType": "ListPurchasableSkusResponse", + "options": { + "(google.api.http).get": "/v1/{customer=accounts/*/customers/*}:listPurchasableSkus" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{customer=accounts/*/customers/*}:listPurchasableSkus" + } + } + ] + }, + "ListPurchasableOffers": { + "requestType": "ListPurchasableOffersRequest", + "responseType": "ListPurchasableOffersResponse", + "options": { + "(google.api.http).get": "/v1/{customer=accounts/*/customers/*}:listPurchasableOffers" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{customer=accounts/*/customers/*}:listPurchasableOffers" + } + } + ] + }, + "RegisterSubscriber": { + "requestType": "RegisterSubscriberRequest", + "responseType": "RegisterSubscriberResponse", + "options": { + "(google.api.http).post": "/v1/{account=accounts/*}:register", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{account=accounts/*}:register", + "body": "*" + } + } + ] + }, + "UnregisterSubscriber": { + "requestType": "UnregisterSubscriberRequest", + "responseType": "UnregisterSubscriberResponse", + "options": { + "(google.api.http).post": "/v1/{account=accounts/*}:unregister", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{account=accounts/*}:unregister", + "body": "*" + } + } + ] + }, + "ListSubscribers": { + "requestType": "ListSubscribersRequest", + "responseType": "ListSubscribersResponse", + "options": { + "(google.api.http).get": "/v1/{account=accounts/*}:listSubscribers" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{account=accounts/*}:listSubscribers" + } + } + ] + } + } + }, + "CheckCloudIdentityAccountsExistRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "domain": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CloudIdentityCustomerAccount": { + "fields": { + "existing": { + "type": "bool", + "id": 1 + }, + "owned": { + "type": "bool", + "id": 2 + }, + "customerName": { + "type": "string", + "id": 3 + }, + "customerCloudIdentityId": { + "type": "string", + "id": 4 + } + } + }, + "CheckCloudIdentityAccountsExistResponse": { + "fields": { + "cloudIdentityAccounts": { + "rule": "repeated", + "type": "CloudIdentityCustomerAccount", + "id": 1 + } + } + }, + "ListCustomersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "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" + } + } + } + }, + "ListCustomersResponse": { + "fields": { + "customers": { + "rule": "repeated", + "type": "Customer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetCustomerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + } + } + }, + "CreateCustomerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customer": { + "type": "Customer", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCustomerRequest": { + "fields": { + "customer": { + "type": "Customer", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "DeleteCustomerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + } + } + }, + "ImportCustomerRequest": { + "oneofs": { + "customerIdentity": { + "oneof": [ + "domain", + "cloudIdentityId" + ] + } + }, + "fields": { + "domain": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cloudIdentityId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "overwriteIfExists": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "channelPartnerId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customer": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + } + } + }, + "ProvisionCloudIdentityRequest": { + "fields": { + "customer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "cloudIdentityInfo": { + "type": "CloudIdentityInfo", + "id": 2 + }, + "user": { + "type": "AdminUser", + "id": 3 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "ListEntitlementsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEntitlementsResponse": { + "fields": { + "entitlements": { + "rule": "repeated", + "type": "Entitlement", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListTransferableSkusRequest": { + "oneofs": { + "transferredCustomerIdentity": { + "oneof": [ + "cloudIdentityId", + "customerName" + ] + } + }, + "fields": { + "cloudIdentityId": { + "type": "string", + "id": 4 + }, + "customerName": { + "type": "string", + "id": 7 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "authToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 6 + } + } + }, + "ListTransferableSkusResponse": { + "fields": { + "transferableSkus": { + "rule": "repeated", + "type": "TransferableSku", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListTransferableOffersRequest": { + "oneofs": { + "transferredCustomerIdentity": { + "oneof": [ + "cloudIdentityId", + "customerName" + ] + } + }, + "fields": { + "cloudIdentityId": { + "type": "string", + "id": 4 + }, + "customerName": { + "type": "string", + "id": 5 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "sku": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTransferableOffersResponse": { + "fields": { + "transferableOffers": { + "rule": "repeated", + "type": "TransferableOffer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TransferableOffer": { + "fields": { + "offer": { + "type": "Offer", + "id": 1 + } + } + }, + "GetEntitlementRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Entitlement" + } + } + } + }, + "ListChannelPartnerLinksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "ChannelPartnerLinkView", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListChannelPartnerLinksResponse": { + "fields": { + "channelPartnerLinks": { + "rule": "repeated", + "type": "ChannelPartnerLink", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetChannelPartnerLinkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "view": { + "type": "ChannelPartnerLinkView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateChannelPartnerLinkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "channelPartnerLink": { + "type": "ChannelPartnerLink", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateChannelPartnerLinkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "channelPartnerLink": { + "type": "ChannelPartnerLink", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCustomerRepricingConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/CustomerRepricingConfig" + } + } + } + }, + "ListCustomerRepricingConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "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" + } + } + } + }, + "ListCustomerRepricingConfigsResponse": { + "fields": { + "customerRepricingConfigs": { + "rule": "repeated", + "type": "CustomerRepricingConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateCustomerRepricingConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "customerRepricingConfig": { + "type": "CustomerRepricingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateCustomerRepricingConfigRequest": { + "fields": { + "customerRepricingConfig": { + "type": "CustomerRepricingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCustomerRepricingConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/CustomerRepricingConfig" + } + } + } + }, + "GetChannelPartnerRepricingConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig" + } + } + } + }, + "ListChannelPartnerRepricingConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/ChannelPartnerLink" + } + }, + "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" + } + } + } + }, + "ListChannelPartnerRepricingConfigsResponse": { + "fields": { + "channelPartnerRepricingConfigs": { + "rule": "repeated", + "type": "ChannelPartnerRepricingConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateChannelPartnerRepricingConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/ChannelPartnerLink" + } + }, + "channelPartnerRepricingConfig": { + "type": "ChannelPartnerRepricingConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateChannelPartnerRepricingConfigRequest": { + "fields": { + "channelPartnerRepricingConfig": { + "type": "ChannelPartnerRepricingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteChannelPartnerRepricingConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/ChannelPartnerRepricingConfig" + } + } + } + }, + "CreateEntitlementRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "entitlement": { + "type": "Entitlement", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TransferEntitlementsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entitlements": { + "rule": "repeated", + "type": "Entitlement", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authToken": { + "type": "string", + "id": 4 + }, + "requestId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TransferEntitlementsResponse": { + "fields": { + "entitlements": { + "rule": "repeated", + "type": "Entitlement", + "id": 1 + } + } + }, + "TransferEntitlementsToGoogleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entitlements": { + "rule": "repeated", + "type": "Entitlement", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChangeParametersRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "purchaseOrderId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChangeRenewalSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "renewalSettings": { + "type": "RenewalSettings", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ChangeOfferRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "offer": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Offer" + } + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "purchaseOrderId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StartPaidServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelEntitlementRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SuspendEntitlementRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ActivateEntitlementRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LookupOfferRequest": { + "fields": { + "entitlement": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Entitlement" + } + } + } + }, + "ListProductsRequest": { + "fields": { + "account": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListProductsResponse": { + "fields": { + "products": { + "rule": "repeated", + "type": "Product", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSkusRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Product" + } + }, + "account": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSkusResponse": { + "fields": { + "skus": { + "rule": "repeated", + "type": "Sku", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListOffersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "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" + } + }, + "languageCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListOffersResponse": { + "fields": { + "offers": { + "rule": "repeated", + "type": "Offer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListPurchasableSkusRequest": { + "oneofs": { + "purchaseOption": { + "oneof": [ + "createEntitlementPurchase", + "changeOfferPurchase" + ] + } + }, + "fields": { + "createEntitlementPurchase": { + "type": "CreateEntitlementPurchase", + "id": 2 + }, + "changeOfferPurchase": { + "type": "ChangeOfferPurchase", + "id": 3 + }, + "customer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CreateEntitlementPurchase": { + "fields": { + "product": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ChangeOfferPurchase": { + "fields": { + "entitlement": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "changeType": { + "type": "ChangeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ChangeType": { + "values": { + "CHANGE_TYPE_UNSPECIFIED": 0, + "UPGRADE": 1, + "DOWNGRADE": 2 + } + } + } + } + } + }, + "ListPurchasableSkusResponse": { + "fields": { + "purchasableSkus": { + "rule": "repeated", + "type": "PurchasableSku", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PurchasableSku": { + "fields": { + "sku": { + "type": "Sku", + "id": 1 + } + } + }, + "ListPurchasableOffersRequest": { + "oneofs": { + "purchaseOption": { + "oneof": [ + "createEntitlementPurchase", + "changeOfferPurchase" + ] + } + }, + "fields": { + "createEntitlementPurchase": { + "type": "CreateEntitlementPurchase", + "id": 2 + }, + "changeOfferPurchase": { + "type": "ChangeOfferPurchase", + "id": 3 + }, + "customer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CreateEntitlementPurchase": { + "fields": { + "sku": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ChangeOfferPurchase": { + "fields": { + "entitlement": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "newSku": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ListPurchasableOffersResponse": { + "fields": { + "purchasableOffers": { + "rule": "repeated", + "type": "PurchasableOffer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "PurchasableOffer": { + "fields": { + "offer": { + "type": "Offer", + "id": 1 + } + } + }, + "RegisterSubscriberRequest": { + "fields": { + "account": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serviceAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RegisterSubscriberResponse": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, + "UnregisterSubscriberRequest": { + "fields": { + "account": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serviceAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UnregisterSubscriberResponse": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, + "ListSubscribersRequest": { + "fields": { + "account": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSubscribersResponse": { + "fields": { + "topic": { + "type": "string", + "id": 1 + }, + "serviceAccounts": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "CustomerEvent": { + "fields": { + "customer": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "eventType": { + "type": "Type", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "PRIMARY_DOMAIN_CHANGED": 1, + "PRIMARY_DOMAIN_VERIFIED": 2 + } + } + } + }, + "EntitlementEvent": { + "fields": { + "entitlement": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Entitlement" + } + }, + "eventType": { + "type": "Type", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "CREATED": 1, + "PRICE_PLAN_SWITCHED": 3, + "COMMITMENT_CHANGED": 4, + "RENEWED": 5, + "SUSPENDED": 6, + "ACTIVATED": 7, + "CANCELLED": 8, + "SKU_CHANGED": 9, + "RENEWAL_SETTING_CHANGED": 10, + "PAID_SERVICE_STARTED": 11, + "LICENSE_ASSIGNMENT_CHANGED": 12, + "LICENSE_CAP_CHANGED": 13 + } + } + } + }, + "SubscriberEvent": { + "oneofs": { + "event": { + "oneof": [ + "customerEvent", + "entitlementEvent" + ] + } + }, + "fields": { + "customerEvent": { + "type": "CustomerEvent", + "id": 1 + }, + "entitlementEvent": { + "type": "EntitlementEvent", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/decimal;decimal", + "java_multiple_files": true, + "java_outer_classname": "DecimalProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "PostalAddress": { + "fields": { + "revision": { + "type": "int32", + "id": 1 + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "postalCode": { + "type": "string", + "id": 4 + }, + "sortingCode": { + "type": "string", + "id": 5 + }, + "administrativeArea": { + "type": "string", + "id": 6 + }, + "locality": { + "type": "string", + "id": 7 + }, + "sublocality": { + "type": "string", + "id": 8 + }, + "addressLines": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "recipients": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "organization": { + "type": "string", + "id": 11 + } + } + }, + "Money": { + "fields": { + "currencyCode": { + "type": "string", + "id": 1 + }, + "units": { + "type": "int64", + "id": 2 + }, + "nanos": { + "type": "int32", + "id": 3 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "DateTime": { + "oneofs": { + "timeOffset": { + "oneof": [ + "utcOffset", + "timeZone" + ] + } + }, + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + }, + "hours": { + "type": "int32", + "id": 4 + }, + "minutes": { + "type": "int32", + "id": 5 + }, + "seconds": { + "type": "int32", + "id": 6 + }, + "nanos": { + "type": "int32", + "id": 7 + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "timeZone": { + "type": "TimeZone", + "id": 9 + } + } + }, + "TimeZone": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "Decimal": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-channel/samples/README.md b/packages/google-cloud-channel/samples/README.md new file mode 100644 index 00000000000..d95f61c74d6 --- /dev/null +++ b/packages/google-cloud-channel/samples/README.md @@ -0,0 +1,932 @@ +[//]: # "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 + +# [Cloud Channel API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Cloud_channel_reports_service.fetch_report_results](#cloud_channel_reports_service.fetch_report_results) + * [Cloud_channel_reports_service.list_reports](#cloud_channel_reports_service.list_reports) + * [Cloud_channel_reports_service.run_report_job](#cloud_channel_reports_service.run_report_job) + * [Cloud_channel_service.activate_entitlement](#cloud_channel_service.activate_entitlement) + * [Cloud_channel_service.cancel_entitlement](#cloud_channel_service.cancel_entitlement) + * [Cloud_channel_service.change_offer](#cloud_channel_service.change_offer) + * [Cloud_channel_service.change_parameters](#cloud_channel_service.change_parameters) + * [Cloud_channel_service.change_renewal_settings](#cloud_channel_service.change_renewal_settings) + * [Cloud_channel_service.check_cloud_identity_accounts_exist](#cloud_channel_service.check_cloud_identity_accounts_exist) + * [Cloud_channel_service.create_channel_partner_link](#cloud_channel_service.create_channel_partner_link) + * [Cloud_channel_service.create_channel_partner_repricing_config](#cloud_channel_service.create_channel_partner_repricing_config) + * [Cloud_channel_service.create_customer](#cloud_channel_service.create_customer) + * [Cloud_channel_service.create_customer_repricing_config](#cloud_channel_service.create_customer_repricing_config) + * [Cloud_channel_service.create_entitlement](#cloud_channel_service.create_entitlement) + * [Cloud_channel_service.delete_channel_partner_repricing_config](#cloud_channel_service.delete_channel_partner_repricing_config) + * [Cloud_channel_service.delete_customer](#cloud_channel_service.delete_customer) + * [Cloud_channel_service.delete_customer_repricing_config](#cloud_channel_service.delete_customer_repricing_config) + * [Cloud_channel_service.get_channel_partner_link](#cloud_channel_service.get_channel_partner_link) + * [Cloud_channel_service.get_channel_partner_repricing_config](#cloud_channel_service.get_channel_partner_repricing_config) + * [Cloud_channel_service.get_customer](#cloud_channel_service.get_customer) + * [Cloud_channel_service.get_customer_repricing_config](#cloud_channel_service.get_customer_repricing_config) + * [Cloud_channel_service.get_entitlement](#cloud_channel_service.get_entitlement) + * [Cloud_channel_service.import_customer](#cloud_channel_service.import_customer) + * [Cloud_channel_service.list_channel_partner_links](#cloud_channel_service.list_channel_partner_links) + * [Cloud_channel_service.list_channel_partner_repricing_configs](#cloud_channel_service.list_channel_partner_repricing_configs) + * [Cloud_channel_service.list_customer_repricing_configs](#cloud_channel_service.list_customer_repricing_configs) + * [Cloud_channel_service.list_customers](#cloud_channel_service.list_customers) + * [Cloud_channel_service.list_entitlements](#cloud_channel_service.list_entitlements) + * [Cloud_channel_service.list_offers](#cloud_channel_service.list_offers) + * [Cloud_channel_service.list_products](#cloud_channel_service.list_products) + * [Cloud_channel_service.list_purchasable_offers](#cloud_channel_service.list_purchasable_offers) + * [Cloud_channel_service.list_purchasable_skus](#cloud_channel_service.list_purchasable_skus) + * [Cloud_channel_service.list_skus](#cloud_channel_service.list_skus) + * [Cloud_channel_service.list_subscribers](#cloud_channel_service.list_subscribers) + * [Cloud_channel_service.list_transferable_offers](#cloud_channel_service.list_transferable_offers) + * [Cloud_channel_service.list_transferable_skus](#cloud_channel_service.list_transferable_skus) + * [Cloud_channel_service.lookup_offer](#cloud_channel_service.lookup_offer) + * [Cloud_channel_service.provision_cloud_identity](#cloud_channel_service.provision_cloud_identity) + * [Cloud_channel_service.register_subscriber](#cloud_channel_service.register_subscriber) + * [Cloud_channel_service.start_paid_service](#cloud_channel_service.start_paid_service) + * [Cloud_channel_service.suspend_entitlement](#cloud_channel_service.suspend_entitlement) + * [Cloud_channel_service.transfer_entitlements](#cloud_channel_service.transfer_entitlements) + * [Cloud_channel_service.transfer_entitlements_to_google](#cloud_channel_service.transfer_entitlements_to_google) + * [Cloud_channel_service.unregister_subscriber](#cloud_channel_service.unregister_subscriber) + * [Cloud_channel_service.update_channel_partner_link](#cloud_channel_service.update_channel_partner_link) + * [Cloud_channel_service.update_channel_partner_repricing_config](#cloud_channel_service.update_channel_partner_repricing_config) + * [Cloud_channel_service.update_customer](#cloud_channel_service.update_customer) + * [Cloud_channel_service.update_customer_repricing_config](#cloud_channel_service.update_customer_repricing_config) + * [Quickstart](#quickstart) + * [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/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Cloud_channel_reports_service.fetch_report_results + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js` + + +----- + + + + +### Cloud_channel_reports_service.list_reports + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js` + + +----- + + + + +### Cloud_channel_reports_service.run_report_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js` + + +----- + + + + +### Cloud_channel_service.activate_entitlement + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js` + + +----- + + + + +### Cloud_channel_service.cancel_entitlement + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js` + + +----- + + + + +### Cloud_channel_service.change_offer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js` + + +----- + + + + +### Cloud_channel_service.change_parameters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js` + + +----- + + + + +### Cloud_channel_service.change_renewal_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js` + + +----- + + + + +### Cloud_channel_service.check_cloud_identity_accounts_exist + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js` + + +----- + + + + +### Cloud_channel_service.create_channel_partner_link + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js` + + +----- + + + + +### Cloud_channel_service.create_channel_partner_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.create_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js` + + +----- + + + + +### Cloud_channel_service.create_customer_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.create_entitlement + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js` + + +----- + + + + +### Cloud_channel_service.delete_channel_partner_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.delete_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js` + + +----- + + + + +### Cloud_channel_service.delete_customer_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.get_channel_partner_link + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js` + + +----- + + + + +### Cloud_channel_service.get_channel_partner_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.get_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js` + + +----- + + + + +### Cloud_channel_service.get_customer_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.get_entitlement + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js` + + +----- + + + + +### Cloud_channel_service.import_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js` + + +----- + + + + +### Cloud_channel_service.list_channel_partner_links + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js` + + +----- + + + + +### Cloud_channel_service.list_channel_partner_repricing_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js` + + +----- + + + + +### Cloud_channel_service.list_customer_repricing_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js` + + +----- + + + + +### Cloud_channel_service.list_customers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js` + + +----- + + + + +### Cloud_channel_service.list_entitlements + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js` + + +----- + + + + +### Cloud_channel_service.list_offers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js` + + +----- + + + + +### Cloud_channel_service.list_products + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js` + + +----- + + + + +### Cloud_channel_service.list_purchasable_offers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js` + + +----- + + + + +### Cloud_channel_service.list_purchasable_skus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js` + + +----- + + + + +### Cloud_channel_service.list_skus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js` + + +----- + + + + +### Cloud_channel_service.list_subscribers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js` + + +----- + + + + +### Cloud_channel_service.list_transferable_offers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js` + + +----- + + + + +### Cloud_channel_service.list_transferable_skus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js` + + +----- + + + + +### Cloud_channel_service.lookup_offer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js` + + +----- + + + + +### Cloud_channel_service.provision_cloud_identity + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js` + + +----- + + + + +### Cloud_channel_service.register_subscriber + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js` + + +----- + + + + +### Cloud_channel_service.start_paid_service + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js` + + +----- + + + + +### Cloud_channel_service.suspend_entitlement + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js` + + +----- + + + + +### Cloud_channel_service.transfer_entitlements + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js` + + +----- + + + + +### Cloud_channel_service.transfer_entitlements_to_google + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js` + + +----- + + + + +### Cloud_channel_service.unregister_subscriber + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js` + + +----- + + + + +### Cloud_channel_service.update_channel_partner_link + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js` + + +----- + + + + +### Cloud_channel_service.update_channel_partner_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_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-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js` + + +----- + + + + +### Cloud_channel_service.update_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js` + + +----- + + + + +### Cloud_channel_service.update_customer_repricing_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_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-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/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-channel/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/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-channel/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/test/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/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/channel/ diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js new file mode 100644 index 00000000000..2c609bc5595 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js @@ -0,0 +1,80 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(reportJob) { + // [START cloudchannel_v1_generated_CloudChannelReportsService_FetchReportResults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The report job created by CloudChannelReportsService.RunReportJob google.cloud.channel.v1.CloudChannelReportsService.RunReportJob. + * Report_job uses the format: + * accounts/{account_id}/reportJobs/{report_job_id} + */ + // const reportJob = 'abc123' + /** + * Optional. Requested page size of the report. The server may return fewer results than + * requested. If you don't specify a page size, the server uses a sensible + * default (may change over time). + * The maximum value is 30,000; the server will change larger values to + * 30,000. + */ + // const pageSize = 1234 + /** + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * FetchReportResultsResponse.next_page_token google.cloud.channel.v1.FetchReportResultsResponse.next_page_token of the previous + * CloudChannelReportsService.FetchReportResults google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults call. + */ + // const pageToken = 'abc123' + + // Imports the Channel library + const {CloudChannelReportsServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelReportsServiceClient(); + + async function callFetchReportResults() { + // Construct request + const request = { + reportJob, + }; + + // Run request + const iterable = await channelClient.fetchReportResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchReportResults(); + // [END cloudchannel_v1_generated_CloudChannelReportsService_FetchReportResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js new file mode 100644 index 00000000000..bf37c0e3bb5 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelReportsService_ListReports_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the partner account to list available reports for. + * Parent uses the format: + * accounts/{account_id} + */ + // const parent = 'abc123' + /** + * Optional. Requested page size of the report. The server might return fewer results + * than requested. If unspecified, returns 20 reports. + * The maximum value is 100. + */ + // const pageSize = 1234 + /** + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * ListReportsResponse.next_page_token google.cloud.channel.v1.ListReportsResponse.next_page_token of the previous + * CloudChannelReportsService.ListReports google.cloud.channel.v1.CloudChannelReportsService.ListReports call. + */ + // const pageToken = 'abc123' + /** + * Optional. The BCP-47 language code, such as "en-US". If specified, the + * response is localized to the corresponding language code if the + * original data sources support it. + * Default is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelReportsServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelReportsServiceClient(); + + async function callListReports() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listReportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReports(); + // [END cloudchannel_v1_generated_CloudChannelReportsService_ListReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js new file mode 100644 index 00000000000..8fa60ddbc73 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The report's resource name. Specifies the account and report used to + * generate report data. The report_id identifier is a UID (for example, + * `613bf59q`). + * Name uses the format: + * accounts/{account_id}/reports/{report_id} + */ + // const name = 'abc123' + /** + * Optional. The range of usage or invoice dates to include in the result. + */ + // const dateRange = {} + /** + * Optional. A structured string that defines conditions on dimension columns to + * restrict the report output. + * Filters support logical operators (AND, OR, NOT) and conditional operators + * (=, !=, <, >, <=, and >=) using `column_id` as keys. + * For example: + * `(customer:"accounts/C123abc/customers/S456def" OR + * customer:"accounts/C123abc/customers/S789ghi") AND + * invoice_start_date.year >= 2022` + */ + // const filter = 'abc123' + /** + * Optional. The BCP-47 language code, such as "en-US". If specified, the + * response is localized to the corresponding language code if the + * original data sources support it. + * Default is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelReportsServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelReportsServiceClient(); + + async function callRunReportJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await channelClient.runReportJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunReportJob(); + // [END cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js new file mode 100644 index 00000000000..4f3c8747897 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entitlement to activate. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callActivateEntitlement() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await channelClient.activateEntitlement(request); + const [response] = await operation.promise(); + console.log(response); + } + + callActivateEntitlement(); + // [END cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js new file mode 100644 index 00000000000..c664417d41e --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entitlement to cancel. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCancelEntitlement() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await channelClient.cancelEntitlement(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelEntitlement(); + // [END cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js new file mode 100644 index 00000000000..67749366e1f --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js @@ -0,0 +1,91 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, offer) { + // [START cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entitlement to update. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Required. New Offer. + * Format: accounts/{account_id}/offers/{offer_id}. + */ + // const offer = 'abc123' + /** + * Optional. Parameters needed to purchase the Offer. To view the available Parameters + * refer to the Offer.parameter_definitions google.cloud.channel.v1.Offer.parameter_definitions from the desired offer. + */ + // const parameters = 1234 + /** + * Optional. Purchase order id provided by the reseller. + */ + // const purchaseOrderId = 'abc123' + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callChangeOffer() { + // Construct request + const request = { + name, + offer, + }; + + // Run request + const [operation] = await channelClient.changeOffer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callChangeOffer(); + // [END cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js new file mode 100644 index 00000000000..69c955fbbe2 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, parameters) { + // [START cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entitlement to update. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Required. Entitlement parameters to update. You can only change editable parameters. + * To view the available Parameters for a request, refer to the + * Offer.parameter_definitions google.cloud.channel.v1.Offer.parameter_definitions from the desired offer. + */ + // const parameters = 1234 + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + /** + * Optional. Purchase order ID provided by the reseller. + */ + // const purchaseOrderId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callChangeParameters() { + // Construct request + const request = { + name, + parameters, + }; + + // Run request + const [operation] = await channelClient.changeParameters(request); + const [response] = await operation.promise(); + console.log(response); + } + + callChangeParameters(); + // [END cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js new file mode 100644 index 00000000000..71b2d0efda5 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, renewalSettings) { + // [START cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entitlement to update. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Required. New renewal settings. + */ + // const renewalSettings = {} + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callChangeRenewalSettings() { + // Construct request + const request = { + name, + renewalSettings, + }; + + // Run request + const [operation] = await channelClient.changeRenewalSettings(request); + const [response] = await operation.promise(); + console.log(response); + } + + callChangeRenewalSettings(); + // [END cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js new file mode 100644 index 00000000000..c519611c960 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, domain) { + // [START cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The reseller account's resource name. + * Parent uses the format: accounts/{account_id} + */ + // const parent = 'abc123' + /** + * Required. Domain to fetch for Cloud Identity account customer. + */ + // const domain = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCheckCloudIdentityAccountsExist() { + // Construct request + const request = { + parent, + domain, + }; + + // Run request + const response = await channelClient.checkCloudIdentityAccountsExist(request); + console.log(response); + } + + callCheckCloudIdentityAccountsExist(); + // [END cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js new file mode 100644 index 00000000000..29afadcf520 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, channelPartnerLink) { + // [START cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Create a channel partner link for the provided reseller account's + * resource name. + * Parent uses the format: accounts/{account_id} + */ + // const parent = 'abc123' + /** + * Required. The channel partner link to create. + * Either channel_partner_link.reseller_cloud_identity_id or domain can be + * used to create a link. + */ + // const channelPartnerLink = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCreateChannelPartnerLink() { + // Construct request + const request = { + parent, + channelPartnerLink, + }; + + // Run request + const response = await channelClient.createChannelPartnerLink(request); + console.log(response); + } + + callCreateChannelPartnerLink(); + // [END cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js new file mode 100644 index 00000000000..ec4b22da1dd --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, channelPartnerRepricingConfig) { + // [START cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the ChannelPartner that will receive the repricing + * config. Parent uses the format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id} + */ + // const parent = 'abc123' + /** + * Required. The ChannelPartnerRepricingConfig object to update. + */ + // const channelPartnerRepricingConfig = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCreateChannelPartnerRepricingConfig() { + // Construct request + const request = { + parent, + channelPartnerRepricingConfig, + }; + + // Run request + const response = await channelClient.createChannelPartnerRepricingConfig(request); + console.log(response); + } + + callCreateChannelPartnerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js new file mode 100644 index 00000000000..c7ffac50924 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customer) { + // [START cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of reseller account in which to create the customer. + * Parent uses the format: accounts/{account_id} + */ + // const parent = 'abc123' + /** + * Required. The customer to create. + */ + // const customer = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCreateCustomer() { + // Construct request + const request = { + parent, + customer, + }; + + // Run request + const response = await channelClient.createCustomer(request); + console.log(response); + } + + callCreateCustomer(); + // [END cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js new file mode 100644 index 00000000000..d7e9f1980b7 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customerRepricingConfig) { + // [START cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the customer that will receive this repricing config. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + */ + // const parent = 'abc123' + /** + * Required. The CustomerRepricingConfig object to update. + */ + // const customerRepricingConfig = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCreateCustomerRepricingConfig() { + // Construct request + const request = { + parent, + customerRepricingConfig, + }; + + // Run request + const response = await channelClient.createCustomerRepricingConfig(request); + console.log(response); + } + + callCreateCustomerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js new file mode 100644 index 00000000000..f679ab7c6c4 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, entitlement) { + // [START cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller's customer account in which to create the + * entitlement. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + */ + // const parent = 'abc123' + /** + * Required. The entitlement to create. + */ + // const entitlement = {} + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callCreateEntitlement() { + // Construct request + const request = { + parent, + entitlement, + }; + + // Run request + const [operation] = await channelClient.createEntitlement(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEntitlement(); + // [END cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js new file mode 100644 index 00000000000..603a19b09f3 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_DeleteChannelPartnerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the channel partner repricing config rule to delete. + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callDeleteChannelPartnerRepricingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.deleteChannelPartnerRepricingConfig(request); + console.log(response); + } + + callDeleteChannelPartnerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_DeleteChannelPartnerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js new file mode 100644 index 00000000000..b4c54c9a8b7 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the customer to delete. + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callDeleteCustomer() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.deleteCustomer(request); + console.log(response); + } + + callDeleteCustomer(); + // [END cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js new file mode 100644 index 00000000000..3337a795604 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_DeleteCustomerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the customer repricing config rule to delete. + * Format: + * accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callDeleteCustomerRepricingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.deleteCustomerRepricingConfig(request); + console.log(response); + } + + callDeleteCustomerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_DeleteCustomerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js new file mode 100644 index 00000000000..dc136c38aa5 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the channel partner link to retrieve. + * Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} + * where {id} is the Cloud Identity ID of the partner. + */ + // const name = 'abc123' + /** + * Optional. The level of granularity the ChannelPartnerLink will display. + */ + // const view = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callGetChannelPartnerLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.getChannelPartnerLink(request); + console.log(response); + } + + callGetChannelPartnerLink(); + // [END cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js new file mode 100644 index 00000000000..77803006a9d --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the ChannelPartnerRepricingConfig + * Format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}. + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callGetChannelPartnerRepricingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.getChannelPartnerRepricingConfig(request); + console.log(response); + } + + callGetChannelPartnerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js new file mode 100644 index 00000000000..7c9be5abcbe --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_GetCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the customer to retrieve. + * Name uses the format: accounts/{account_id}/customers/{customer_id} + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callGetCustomer() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.getCustomer(request); + console.log(response); + } + + callGetCustomer(); + // [END cloudchannel_v1_generated_CloudChannelService_GetCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js new file mode 100644 index 00000000000..dff81702966 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_GetCustomerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the CustomerRepricingConfig. + * Format: + * accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callGetCustomerRepricingConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.getCustomerRepricingConfig(request); + console.log(response); + } + + callGetCustomerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_GetCustomerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js new file mode 100644 index 00000000000..b9ed504c2c6 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entitlement to retrieve. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callGetEntitlement() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await channelClient.getEntitlement(request); + console.log(response); + } + + callGetEntitlement(); + // [END cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js new file mode 100644 index 00000000000..2238a6a769e --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js @@ -0,0 +1,99 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(domain, cloudIdentityId, parent, overwriteIfExists) { + // [START cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Customer domain. + */ + // const domain = 'abc123' + /** + * Required. Customer's Cloud Identity ID + */ + // const cloudIdentityId = 'abc123' + /** + * Required. The resource name of the reseller's account. + * Parent takes the format: accounts/{account_id} or + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id} + */ + // const parent = 'abc123' + /** + * Optional. The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + */ + // const authToken = 'abc123' + /** + * Required. Choose to overwrite an existing customer if found. + * This must be set to true if there is an existing customer with a + * conflicting region code or domain. + */ + // const overwriteIfExists = true + /** + * Optional. Cloud Identity ID of a channel partner who will be the direct reseller for + * the customer's order. This field is required for 2-tier transfer scenarios + * and can be provided via the request Parent binding as well. + */ + // const channelPartnerId = 'abc123' + /** + * Optional. Specifies the customer that will receive imported Cloud Identity + * information. + * Format: accounts/{account_id}/customers/{customer_id} + */ + // const customer = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callImportCustomer() { + // Construct request + const request = { + domain, + cloudIdentityId, + parent, + overwriteIfExists, + }; + + // Run request + const response = await channelClient.importCustomer(request); + console.log(response); + } + + callImportCustomer(); + // [END cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js new file mode 100644 index 00000000000..5e489026828 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller account for listing channel partner + * links. + * Parent uses the format: accounts/{account_id} + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, server will pick a default size (25). + * The maximum value is 200; the server will coerce values above 200. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + * Obtained using + * ListChannelPartnerLinksResponse.next_page_token google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token of the previous + * CloudChannelService.ListChannelPartnerLinks google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks call. + */ + // const pageToken = 'abc123' + /** + * Optional. The level of granularity the ChannelPartnerLink will display. + */ + // const view = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListChannelPartnerLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listChannelPartnerLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChannelPartnerLinks(); + // [END cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js new file mode 100644 index 00000000000..7b94fd53b91 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js @@ -0,0 +1,91 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerRepricingConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the account's ChannelPartnerLink google.cloud.channel.v1.ChannelPartnerLink. + * Parent uses the format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. + * Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs + * for all channel partners. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * ListChannelPartnerRepricingConfigsResponse.next_page_token google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.next_page_token of the + * previous CloudChannelService.ListChannelPartnerRepricingConfigs google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs call. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter for CloudChannelService.ListChannelPartnerRepricingConfigs + * results (channel_partner_link only). You can use this filter when you + * support a BatchGet-like query. + * To use the filter, you must set + * `parent=accounts/{account_id}/channelPartnerLinks/-`. + * Example: `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c1` OR `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c2`. + */ + // const filter = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListChannelPartnerRepricingConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listChannelPartnerRepricingConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChannelPartnerRepricingConfigs(); + // [END cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerRepricingConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js new file mode 100644 index 00000000000..10b7419a8a3 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListCustomerRepricingConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the customer. + * Parent uses the format: accounts/{account_id}/customers/{customer_id}. + * Supports accounts/{account_id}/customers/- to retrieve configs for all + * customers. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * ListCustomerRepricingConfigsResponse.next_page_token google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token of the previous + * CloudChannelService.ListCustomerRepricingConfigs google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs call. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter for CloudChannelService.ListCustomerRepricingConfigs + * results (customer only). You can use this filter when you support + * a BatchGet-like query. + * To use the filter, you must set `parent=accounts/{account_id}/customers/-`. + * Example: customer = accounts/account_id/customers/c1 OR + * customer = accounts/account_id/customers/c2. + */ + // const filter = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListCustomerRepricingConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listCustomerRepricingConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomerRepricingConfigs(); + // [END cloudchannel_v1_generated_CloudChannelService_ListCustomerRepricingConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js new file mode 100644 index 00000000000..462fa64938f --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListCustomers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller account to list customers from. + * Parent uses the format: accounts/{account_id}. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of customers to return. The service may return fewer + * than this value. If unspecified, returns at most 10 customers. The + * maximum value is 50. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results other than the first page. + * Obtained through + * ListCustomersResponse.next_page_token google.cloud.channel.v1.ListCustomersResponse.next_page_token of the previous + * CloudChannelService.ListCustomers google.cloud.channel.v1.CloudChannelService.ListCustomers call. + */ + // const pageToken = 'abc123' + /** + * Optional. Filters applied to the CloudChannelService.ListCustomers results. See + * https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers + * for more information. + */ + // const filter = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListCustomers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listCustomersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCustomers(); + // [END cloudchannel_v1_generated_CloudChannelService_ListCustomers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js new file mode 100644 index 00000000000..ce44dbcab28 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js @@ -0,0 +1,78 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller's customer account to list + * entitlements for. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, return at most 50 entitlements. + * The maximum value is 100; the server will coerce values above 100. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + * Obtained using + * ListEntitlementsResponse.next_page_token google.cloud.channel.v1.ListEntitlementsResponse.next_page_token of the previous + * CloudChannelService.ListEntitlements google.cloud.channel.v1.CloudChannelService.ListEntitlements call. + */ + // const pageToken = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListEntitlements() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listEntitlementsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEntitlements(); + // [END cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js new file mode 100644 index 00000000000..1f558b118af --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListOffers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller account from which to list Offers. + * Parent uses the format: accounts/{account_id}. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 500 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + */ + // const pageToken = 'abc123' + /** + * Optional. The expression to filter results by name (name of + * the Offer), sku.name (name of the SKU), or sku.product.name (name of the + * Product). + * Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1 + * Example 2: name=accounts/a1/offers/o1 + */ + // const filter = 'abc123' + /** + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListOffers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listOffersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOffers(); + // [END cloudchannel_v1_generated_CloudChannelService_ListOffers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js new file mode 100644 index 00000000000..9f91c77921e --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js @@ -0,0 +1,80 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(account) { + // [START cloudchannel_v1_generated_CloudChannelService_ListProducts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller account. + * Format: accounts/{account_id}. + */ + // const account = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Products. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + */ + // const pageToken = 'abc123' + /** + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListProducts() { + // Construct request + const request = { + account, + }; + + // Run request + const iterable = await channelClient.listProductsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProducts(); + // [END cloudchannel_v1_generated_CloudChannelService_ListProducts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js new file mode 100644 index 00000000000..8c64e9f9784 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customer) { + // [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * List Offers for CreateEntitlement purchase. + */ + // const createEntitlementPurchase = {} + /** + * List Offers for ChangeOffer purchase. + */ + // const changeOfferPurchase = {} + /** + * Required. The resource name of the customer to list Offers for. + * Format: accounts/{account_id}/customers/{customer_id}. + */ + // const customer = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + */ + // const pageToken = 'abc123' + /** + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListPurchasableOffers() { + // Construct request + const request = { + customer, + }; + + // Run request + const iterable = await channelClient.listPurchasableOffersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPurchasableOffers(); + // [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js new file mode 100644 index 00000000000..ea2114b37a5 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customer) { + // [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * List SKUs for CreateEntitlement purchase. + */ + // const createEntitlementPurchase = {} + /** + * List SKUs for ChangeOffer purchase with a new SKU. + */ + // const changeOfferPurchase = {} + /** + * Required. The resource name of the customer to list SKUs for. + * Format: accounts/{account_id}/customers/{customer_id}. + */ + // const customer = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + */ + // const pageToken = 'abc123' + /** + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListPurchasableSkus() { + // Construct request + const request = { + customer, + }; + + // Run request + const iterable = await channelClient.listPurchasableSkusAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPurchasableSkus(); + // [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js new file mode 100644 index 00000000000..6c85e15d65a --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, account) { + // [START cloudchannel_v1_generated_CloudChannelService_ListSkus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Product to list SKUs for. + * Parent uses the format: products/{product_id}. + * Supports products/- to retrieve SKUs for all products. + */ + // const parent = 'abc123' + /** + * Required. Resource name of the reseller. + * Format: accounts/{account_id}. + */ + // const account = 'abc123' + /** + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * Optional. A token for a page of results other than the first page. + * Optional. + */ + // const pageToken = 'abc123' + /** + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListSkus() { + // Construct request + const request = { + parent, + account, + }; + + // Run request + const iterable = await channelClient.listSkusAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSkus(); + // [END cloudchannel_v1_generated_CloudChannelService_ListSkus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js new file mode 100644 index 00000000000..baaa56399db --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(account) { + // [START cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the account. + */ + // const account = 'abc123' + /** + * Optional. The maximum number of service accounts to return. The service may return + * fewer than this value. + * If unspecified, returns at most 100 service accounts. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListSubscribers() { + // Construct request + const request = { + account, + }; + + // Run request + const iterable = await channelClient.listSubscribersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSubscribers(); + // [END cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js new file mode 100644 index 00000000000..cbddd152d8e --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js @@ -0,0 +1,96 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, sku) { + // [START cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Customer's Cloud Identity ID + */ + // const cloudIdentityId = 'abc123' + /** + * A reseller should create a customer and use the resource name of + * that customer here. + */ + // const customerName = 'abc123' + /** + * Required. The resource name of the reseller's account. + */ + // const parent = 'abc123' + /** + * Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 offers. + * The maximum value is 1000; the server will coerce values above 1000. + */ + // const pageSize = 1234 + /** + * A token for a page of results other than the first page. + * Obtained using + * ListTransferableOffersResponse.next_page_token google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token of the previous + * CloudChannelService.ListTransferableOffers google.cloud.channel.v1.CloudChannelService.ListTransferableOffers call. + */ + // const pageToken = 'abc123' + /** + * Required. The SKU to look up Offers for. + */ + // const sku = 'abc123' + /** + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListTransferableOffers() { + // Construct request + const request = { + parent, + sku, + }; + + // Run request + const iterable = await channelClient.listTransferableOffersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferableOffers(); + // [END cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js new file mode 100644 index 00000000000..feb99ba9ec6 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js @@ -0,0 +1,104 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Customer's Cloud Identity ID + */ + // const cloudIdentityId = 'abc123' + /** + * A reseller is required to create a customer and use the resource name of + * the created customer here. + * Customer_name uses the format: + * accounts/{account_id}/customers/{customer_id} + */ + // const customerName = 'abc123' + /** + * Required. The reseller account's resource name. + * Parent uses the format: accounts/{account_id} + */ + // const parent = 'abc123' + /** + * The requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * Optional. + */ + // const pageSize = 1234 + /** + * A token for a page of results other than the first page. + * Obtained using + * ListTransferableSkusResponse.next_page_token google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token of the previous + * CloudChannelService.ListTransferableSkus google.cloud.channel.v1.CloudChannelService.ListTransferableSkus call. + * Optional. + */ + // const pageToken = 'abc123' + /** + * Optional. The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + */ + // const authToken = 'abc123' + /** + * The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * Optional. + */ + // const languageCode = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callListTransferableSkus() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await channelClient.listTransferableSkusAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTransferableSkus(); + // [END cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js new file mode 100644 index 00000000000..43c97a05551 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(entitlement) { + // [START cloudchannel_v1_generated_CloudChannelService_LookupOffer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entitlement to retrieve the Offer. + * Entitlement uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const entitlement = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callLookupOffer() { + // Construct request + const request = { + entitlement, + }; + + // Run request + const response = await channelClient.lookupOffer(request); + console.log(response); + } + + callLookupOffer(); + // [END cloudchannel_v1_generated_CloudChannelService_LookupOffer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js new file mode 100644 index 00000000000..81b8b0a0ad2 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customer) { + // [START cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the customer. + * Format: accounts/{account_id}/customers/{customer_id} + */ + // const customer = 'abc123' + /** + * CloudIdentity-specific customer information. + */ + // const cloudIdentityInfo = {} + /** + * Admin user information. + */ + // const user = {} + /** + * Validate the request and preview the review, but do not post it. + */ + // const validateOnly = true + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callProvisionCloudIdentity() { + // Construct request + const request = { + customer, + }; + + // Run request + const [operation] = await channelClient.provisionCloudIdentity(request); + const [response] = await operation.promise(); + console.log(response); + } + + callProvisionCloudIdentity(); + // [END cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js new file mode 100644 index 00000000000..a25e0a9dbf1 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(account, serviceAccount) { + // [START cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the account. + */ + // const account = 'abc123' + /** + * Required. Service account that provides subscriber access to the registered topic. + */ + // const serviceAccount = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callRegisterSubscriber() { + // Construct request + const request = { + account, + serviceAccount, + }; + + // Run request + const response = await channelClient.registerSubscriber(request); + console.log(response); + } + + callRegisterSubscriber(); + // [END cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js new file mode 100644 index 00000000000..6140f736ef7 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_StartPaidService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the entitlement to start a paid service for. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callStartPaidService() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await channelClient.startPaidService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartPaidService(); + // [END cloudchannel_v1_generated_CloudChannelService_StartPaidService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js new file mode 100644 index 00000000000..736e5f95c44 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the entitlement to suspend. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + */ + // const name = 'abc123' + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callSuspendEntitlement() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await channelClient.suspendEntitlement(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSuspendEntitlement(); + // [END cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js new file mode 100644 index 00000000000..3320c0f434b --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js @@ -0,0 +1,88 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, entitlements) { + // [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller's customer account that will receive + * transferred entitlements. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + */ + // const parent = 'abc123' + /** + * Required. The new entitlements to create or transfer. + */ + // const entitlements = 1234 + /** + * The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + */ + // const authToken = 'abc123' + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callTransferEntitlements() { + // Construct request + const request = { + parent, + entitlements, + }; + + // Run request + const [operation] = await channelClient.transferEntitlements(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTransferEntitlements(); + // [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js new file mode 100644 index 00000000000..ca167240567 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, entitlements) { + // [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the reseller's customer account where the entitlements + * transfer from. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + */ + // const parent = 'abc123' + /** + * Required. The entitlements to transfer to Google. + */ + // const entitlements = 1234 + /** + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + */ + // const requestId = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callTransferEntitlementsToGoogle() { + // Construct request + const request = { + parent, + entitlements, + }; + + // Run request + const [operation] = await channelClient.transferEntitlementsToGoogle(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTransferEntitlementsToGoogle(); + // [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js new file mode 100644 index 00000000000..45cfe161713 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(account, serviceAccount) { + // [START cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the account. + */ + // const account = 'abc123' + /** + * Required. Service account to unregister from subscriber access to the topic. + */ + // const serviceAccount = 'abc123' + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callUnregisterSubscriber() { + // Construct request + const request = { + account, + serviceAccount, + }; + + // Run request + const response = await channelClient.unregisterSubscriber(request); + console.log(response); + } + + callUnregisterSubscriber(); + // [END cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js new file mode 100644 index 00000000000..b21cbef5557 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, channelPartnerLink, updateMask) { + // [START cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the channel partner link to cancel. + * Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} + * where {id} is the Cloud Identity ID of the partner. + */ + // const name = 'abc123' + /** + * Required. The channel partner link to update. Only channel_partner_link.link_state + * is allowed for updates. + */ + // const channelPartnerLink = {} + /** + * Required. The update mask that applies to the resource. + * The only allowable value for an update mask is + * channel_partner_link.link_state. + */ + // const updateMask = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callUpdateChannelPartnerLink() { + // Construct request + const request = { + name, + channelPartnerLink, + updateMask, + }; + + // Run request + const response = await channelClient.updateChannelPartnerLink(request); + console.log(response); + } + + callUpdateChannelPartnerLink(); + // [END cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js new file mode 100644 index 00000000000..6dfb5c06606 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(channelPartnerRepricingConfig) { + // [START cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ChannelPartnerRepricingConfig object to update. + */ + // const channelPartnerRepricingConfig = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callUpdateChannelPartnerRepricingConfig() { + // Construct request + const request = { + channelPartnerRepricingConfig, + }; + + // Run request + const response = await channelClient.updateChannelPartnerRepricingConfig(request); + console.log(response); + } + + callUpdateChannelPartnerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js new file mode 100644 index 00000000000..fb7ed485b06 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customer) { + // [START cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. New contents of the customer. + */ + // const customer = {} + /** + * The update mask that applies to the resource. + * Optional. + */ + // const updateMask = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callUpdateCustomer() { + // Construct request + const request = { + customer, + }; + + // Run request + const response = await channelClient.updateCustomer(request); + console.log(response); + } + + callUpdateCustomer(); + // [END cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js new file mode 100644 index 00000000000..becdd61604c --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customerRepricingConfig) { + // [START cloudchannel_v1_generated_CloudChannelService_UpdateCustomerRepricingConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The CustomerRepricingConfig object to update. + */ + // const customerRepricingConfig = {} + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callUpdateCustomerRepricingConfig() { + // Construct request + const request = { + customerRepricingConfig, + }; + + // Run request + const response = await channelClient.updateCustomerRepricingConfig(request); + console.log(response); + } + + callUpdateCustomerRepricingConfig(); + // [END cloudchannel_v1_generated_CloudChannelService_UpdateCustomerRepricingConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json b/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json new file mode 100644 index 00000000000..ab1c91ca689 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json @@ -0,0 +1,2323 @@ +{ + "clientLibrary": { + "name": "nodejs-channel", + "version": "2.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.channel.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_async", + "title": "CloudChannelReportsService runReportJob Sample", + "origin": "API_DEFINITION", + "description": " Begins generation of data for a given report. The report identifier is a UID (for example, `613bf59q`). Possible error codes: * PERMISSION_DENIED: The user doesn't have access to this report. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The report identifier was not found. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. To get the results of report generation, call [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults] with the [RunReportJobResponse.report_job][google.cloud.channel.v1.RunReportJobResponse.report_job].", + "canonical": true, + "file": "cloud_channel_reports_service.run_report_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunReportJob", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService.RunReportJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "date_range", + "type": ".google.cloud.channel.v1.DateRange" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelReportsServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelReportsServiceClient" + }, + "method": { + "shortName": "RunReportJob", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService.RunReportJob", + "service": { + "shortName": "CloudChannelReportsService", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelReportsService_FetchReportResults_async", + "title": "CloudChannelReportsService fetchReportResults Sample", + "origin": "API_DEFINITION", + "description": " Retrieves data generated by [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob].", + "canonical": true, + "file": "cloud_channel_reports_service.fetch_report_results.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchReportResults", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults", + "async": true, + "parameters": [ + { + "name": "report_job", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.FetchReportResultsResponse", + "client": { + "shortName": "CloudChannelReportsServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelReportsServiceClient" + }, + "method": { + "shortName": "FetchReportResults", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults", + "service": { + "shortName": "CloudChannelReportsService", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelReportsService_ListReports_async", + "title": "CloudChannelReportsService listReports Sample", + "origin": "API_DEFINITION", + "description": " Lists the reports that RunReportJob can run. These reports include an ID, a description, and the list of columns that will be in the result.", + "canonical": true, + "file": "cloud_channel_reports_service.list_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReports", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService.ListReports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListReportsResponse", + "client": { + "shortName": "CloudChannelReportsServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelReportsServiceClient" + }, + "method": { + "shortName": "ListReports", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService.ListReports", + "service": { + "shortName": "CloudChannelReportsService", + "fullName": "google.cloud.channel.v1.CloudChannelReportsService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListCustomers_async", + "title": "CloudChannelReportsService listCustomers Sample", + "origin": "API_DEFINITION", + "description": " List [Customer][google.cloud.channel.v1.Customer]s. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: List of [Customer][google.cloud.channel.v1.Customer]s, or an empty list if there are no customers.", + "canonical": true, + "file": "cloud_channel_service.list_customers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListCustomers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListCustomersResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListCustomers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListCustomers", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetCustomer_async", + "title": "CloudChannelReportsService getCustomer Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Customer][google.cloud.channel.v1.Customer] resource. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer resource doesn't exist. Usually the result of an invalid name parameter. Return value: The [Customer][google.cloud.channel.v1.Customer] resource.", + "canonical": true, + "file": "cloud_channel_service.get_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetCustomer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.Customer", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "GetCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetCustomer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async", + "title": "CloudChannelReportsService checkCloudIdentityAccountsExist Sample", + "origin": "API_DEFINITION", + "description": " Confirms the existence of Cloud Identity accounts based on the domain and if the Cloud Identity accounts are owned by the reseller. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INVALID_VALUE: Invalid domain value in the request. Return value: A list of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources for the domain (may be empty) Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if no [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources match the domain.", + "canonical": true, + "file": "cloud_channel_service.check_cloud_identity_accounts_exist.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckCloudIdentityAccountsExist", + "fullName": "google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "domain", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CheckCloudIdentityAccountsExist", + "fullName": "google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async", + "title": "CloudChannelReportsService createCustomer Sample", + "origin": "API_DEFINITION", + "description": " Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * Domain field value doesn't match the primary email domain. Return value: The newly created [Customer][google.cloud.channel.v1.Customer] resource.", + "canonical": true, + "file": "cloud_channel_service.create_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateCustomer", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "customer", + "type": ".google.cloud.channel.v1.Customer" + } + ], + "resultType": ".google.cloud.channel.v1.Customer", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CreateCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateCustomer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async", + "title": "CloudChannelReportsService updateCustomer Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing [Customer][google.cloud.channel.v1.Customer] resource for the reseller or distributor. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name in the request. Return value: The updated [Customer][google.cloud.channel.v1.Customer] resource.", + "canonical": true, + "file": "cloud_channel_service.update_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateCustomer", + "async": true, + "parameters": [ + { + "name": "customer", + "type": ".google.cloud.channel.v1.Customer" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.channel.v1.Customer", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "UpdateCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateCustomer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async", + "title": "CloudChannelReportsService deleteCustomer Sample", + "origin": "API_DEFINITION", + "description": " Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently. Possible error codes: * PERMISSION_DENIED: The account making the request does not own this customer. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * FAILED_PRECONDITION: The customer has existing entitlements. * NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name in the request.", + "canonical": true, + "file": "cloud_channel_service.delete_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.DeleteCustomer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "DeleteCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.DeleteCustomer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async", + "title": "CloudChannelReportsService importCustomer Sample", + "origin": "API_DEFINITION", + "description": " Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked Customer already exists and overwrite_if_exists is true, it will update that Customer's data. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * NOT_FOUND: Cloud Identity doesn't exist or was deleted. * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or invalid. * ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite. Return value: The [Customer][google.cloud.channel.v1.Customer].", + "canonical": true, + "file": "cloud_channel_service.import_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.ImportCustomer", + "async": true, + "parameters": [ + { + "name": "domain", + "type": "TYPE_STRING" + }, + { + "name": "cloud_identity_id", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "auth_token", + "type": "TYPE_STRING" + }, + { + "name": "overwrite_if_exists", + "type": "TYPE_BOOL" + }, + { + "name": "channel_partner_id", + "type": "TYPE_STRING" + }, + { + "name": "customer", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.Customer", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ImportCustomer", + "fullName": "google.cloud.channel.v1.CloudChannelService.ImportCustomer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async", + "title": "CloudChannelReportsService provisionCloudIdentity Sample", + "origin": "API_DEFINITION", + "description": " Creates a Cloud Identity for the given customer using the customer's information, or the information provided here. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer was not found. * ALREADY_EXISTS: The customer's primary email already exists. Retry after changing the customer's primary contact email. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.provision_cloud_identity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ProvisionCloudIdentity", + "fullName": "google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity", + "async": true, + "parameters": [ + { + "name": "customer", + "type": "TYPE_STRING" + }, + { + "name": "cloud_identity_info", + "type": ".google.cloud.channel.v1.CloudIdentityInfo" + }, + { + "name": "user", + "type": ".google.cloud.channel.v1.AdminUser" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ProvisionCloudIdentity", + "fullName": "google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async", + "title": "CloudChannelReportsService listEntitlements Sample", + "origin": "API_DEFINITION", + "description": " Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: A list of the customer's [Entitlement][google.cloud.channel.v1.Entitlement]s.", + "canonical": true, + "file": "cloud_channel_service.list_entitlements.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEntitlements", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListEntitlements", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListEntitlementsResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListEntitlements", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListEntitlements", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async", + "title": "CloudChannelReportsService listTransferableSkus Sample", + "origin": "API_DEFINITION", + "description": " List [TransferableSku][google.cloud.channel.v1.TransferableSku]s of a customer based on the Cloud Identity ID or Customer Name in the request. Use this method to list the entitlements information of an unowned customer. You should provide the customer's Cloud Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The supplied auth token is invalid. * The reseller account making the request is different from the reseller account in the query. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: A list of the customer's [TransferableSku][google.cloud.channel.v1.TransferableSku].", + "canonical": true, + "file": "cloud_channel_service.list_transferable_skus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferableSkus", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListTransferableSkus", + "async": true, + "parameters": [ + { + "name": "cloud_identity_id", + "type": "TYPE_STRING" + }, + { + "name": "customer_name", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "auth_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListTransferableSkusResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListTransferableSkus", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListTransferableSkus", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async", + "title": "CloudChannelReportsService listTransferableOffers Sample", + "origin": "API_DEFINITION", + "description": " List [TransferableOffer][google.cloud.channel.v1.TransferableOffer]s of a customer based on Cloud Identity ID or Customer Name in the request. Use this method when a reseller gets the entitlement information of an unowned customer. The reseller should provide the customer's Cloud Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The customer provided incorrect reseller information when generating auth token. * The reseller account making the request is different from the reseller account in the query. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU.", + "canonical": true, + "file": "cloud_channel_service.list_transferable_offers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTransferableOffers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListTransferableOffers", + "async": true, + "parameters": [ + { + "name": "cloud_identity_id", + "type": "TYPE_STRING" + }, + { + "name": "customer_name", + "type": "TYPE_STRING" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "sku", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListTransferableOffersResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListTransferableOffers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListTransferableOffers", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async", + "title": "CloudChannelReportsService getEntitlement Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer entitlement was not found. Return value: The requested [Entitlement][google.cloud.channel.v1.Entitlement] resource.", + "canonical": true, + "file": "cloud_channel_service.get_entitlement.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetEntitlement", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.Entitlement", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "GetEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetEntitlement", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async", + "title": "CloudChannelReportsService createEntitlement Sample", + "origin": "API_DEFINITION", + "description": " Creates an entitlement for a customer. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * There is already a customer entitlement for a SKU from the same product family. * INVALID_VALUE: Make sure the OfferId is valid. If it is, contact Google Channel support for further troubleshooting. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: * The SKU was already purchased for the customer. * The customer's primary email already exists. Retry after changing the customer's primary contact email. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The domain required for purchasing a SKU has not been verified. * A pre-requisite SKU required to purchase an Add-On SKU is missing. For example, Google Workspace Business Starter is required to purchase Vault or Drive. * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.create_entitlement.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateEntitlement", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "entitlement", + "type": ".google.cloud.channel.v1.Entitlement" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CreateEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateEntitlement", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async", + "title": "CloudChannelReportsService changeParameters Sample", + "origin": "API_DEFINITION", + "description": " Change parameters of the entitlement. An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. For example, the number of seats being changed is greater than the allowed number of max seats, or decreasing seats for a commitment based plan. * NOT_FOUND: Entitlement resource not found. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.change_parameters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ChangeParameters", + "fullName": "google.cloud.channel.v1.CloudChannelService.ChangeParameters", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "parameters", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "purchase_order_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ChangeParameters", + "fullName": "google.cloud.channel.v1.CloudChannelService.ChangeParameters", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async", + "title": "CloudChannelReportsService changeRenewalSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates the renewal settings for an existing customer entitlement. An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a commitment plan. Can't enable or disable renewals for non-commitment plans. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.change_renewal_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ChangeRenewalSettings", + "fullName": "google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "renewal_settings", + "type": ".google.cloud.channel.v1.RenewalSettings" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ChangeRenewalSettings", + "fullName": "google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async", + "title": "CloudChannelReportsService changeOffer Sample", + "origin": "API_DEFINITION", + "description": " Updates the Offer for an existing customer entitlement. An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Offer or Entitlement resource not found. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.change_offer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ChangeOffer", + "fullName": "google.cloud.channel.v1.CloudChannelService.ChangeOffer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "offer", + "type": "TYPE_STRING" + }, + { + "name": "parameters", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "purchase_order_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ChangeOffer", + "fullName": "google.cloud.channel.v1.CloudChannelService.ChangeOffer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_StartPaidService_async", + "title": "CloudChannelReportsService startPaidService Sample", + "origin": "API_DEFINITION", + "description": " Starts paid service for a trial entitlement. Starts paid service for a trial entitlement immediately. This method is only applicable if a plan is set up for a trial entitlement but has some trial days remaining. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for entitlement on trial plans. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.start_paid_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartPaidService", + "fullName": "google.cloud.channel.v1.CloudChannelService.StartPaidService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "StartPaidService", + "fullName": "google.cloud.channel.v1.CloudChannelService.StartPaidService", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async", + "title": "CloudChannelReportsService suspendEntitlement Sample", + "origin": "API_DEFINITION", + "description": " Suspends a previously fulfilled entitlement. An entitlement suspension is a long-running operation. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * NOT_ACTIVE: Entitlement is not active. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.suspend_entitlement.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SuspendEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.SuspendEntitlement", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "SuspendEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.SuspendEntitlement", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async", + "title": "CloudChannelReportsService cancelEntitlement Sample", + "origin": "API_DEFINITION", + "description": " Cancels a previously fulfilled entitlement. An entitlement cancellation is a long-running operation. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * FAILED_PRECONDITION: There are Google Cloud projects linked to the Google Cloud entitlement's Cloud Billing subaccount. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace add-ons, or entitlements for Google Cloud's development platform. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The response will contain google.protobuf.Empty on success. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.cancel_entitlement.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.CancelEntitlement", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CancelEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.CancelEntitlement", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async", + "title": "CloudChannelReportsService activateEntitlement Sample", + "origin": "API_DEFINITION", + "description": " Activates a previously suspended entitlement. Entitlements suspended for pending ToS acceptance can't be activated using this method. An entitlement activation is a long-running operation and it updates the state of the customer entitlement. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * SUSPENSION_NOT_RESELLER_INITIATED: Can only activate reseller-initiated suspensions and entitlements that have accepted the TOS. * NOT_SUSPENDED: Can only activate suspended entitlements not in an ACTIVE state. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.activate_entitlement.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ActivateEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.ActivateEntitlement", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ActivateEntitlement", + "fullName": "google.cloud.channel.v1.CloudChannelService.ActivateEntitlement", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async", + "title": "CloudChannelReportsService transferEntitlements Sample", + "origin": "API_DEFINITION", + "description": " Transfers customer entitlements to new reseller. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * Specify all transferring entitlements. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.transfer_entitlements.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TransferEntitlements", + "fullName": "google.cloud.channel.v1.CloudChannelService.TransferEntitlements", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "entitlements", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "auth_token", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "TransferEntitlements", + "fullName": "google.cloud.channel.v1.CloudChannelService.TransferEntitlements", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async", + "title": "CloudChannelReportsService transferEntitlementsToGoogle Sample", + "origin": "API_DEFINITION", + "description": " Transfers customer entitlements from their current reseller to Google. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The response will contain google.protobuf.Empty on success. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "canonical": true, + "file": "cloud_channel_service.transfer_entitlements_to_google.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TransferEntitlementsToGoogle", + "fullName": "google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogle", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "entitlements", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "TransferEntitlementsToGoogle", + "fullName": "google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogle", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async", + "title": "CloudChannelReportsService listChannelPartnerLinks Sample", + "origin": "API_DEFINITION", + "description": " List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s belonging to a distributor. You must be a distributor to call this method. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: The list of the distributor account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resources.", + "canonical": true, + "file": "cloud_channel_service.list_channel_partner_links.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChannelPartnerLinks", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.channel.v1.ChannelPartnerLinkView" + } + ], + "resultType": ".google.cloud.channel.v1.ListChannelPartnerLinksResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListChannelPartnerLinks", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async", + "title": "CloudChannelReportsService getChannelPartnerLink Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. You must be a distributor to call this method. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: ChannelPartnerLink resource not found because of an invalid channel partner link name. Return value: The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.", + "canonical": true, + "file": "cloud_channel_service.get_channel_partner_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChannelPartnerLink", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.channel.v1.ChannelPartnerLinkView" + } + ], + "resultType": ".google.cloud.channel.v1.ChannelPartnerLink", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "GetChannelPartnerLink", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLink", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async", + "title": "CloudChannelReportsService createChannelPartnerLink Sample", + "origin": "API_DEFINITION", + "description": " Initiates a channel partner link between a distributor and a reseller, or between resellers in an n-tier reseller channel. Invited partners need to follow the invite_link_uri provided in the response to accept. After accepting the invitation, a link is set up between the two parties. You must be a distributor to call this method. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * ALREADY_EXISTS: The ChannelPartnerLink sent in the request already exists. * NOT_FOUND: No Cloud Identity customer exists for provided domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.", + "canonical": true, + "file": "cloud_channel_service.create_channel_partner_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateChannelPartnerLink", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "channel_partner_link", + "type": ".google.cloud.channel.v1.ChannelPartnerLink" + } + ], + "resultType": ".google.cloud.channel.v1.ChannelPartnerLink", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CreateChannelPartnerLink", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async", + "title": "CloudChannelReportsService updateChannelPartnerLink Sample", + "origin": "API_DEFINITION", + "description": " Updates a channel partner link. Distributors call this method to change a link's status. For example, to suspend a partner link. You must be a distributor to call this method. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * Link state cannot change from invited to active or suspended. * Cannot send reseller_cloud_identity_id, invite_url, or name in update mask. * NOT_FOUND: ChannelPartnerLink resource not found. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource.", + "canonical": true, + "file": "cloud_channel_service.update_channel_partner_link.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateChannelPartnerLink", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "channel_partner_link", + "type": ".google.cloud.channel.v1.ChannelPartnerLink" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.channel.v1.ChannelPartnerLink", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "UpdateChannelPartnerLink", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetCustomerRepricingConfig_async", + "title": "CloudChannelReportsService getCustomerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets information about how a Reseller modifies their bill before sending it to a Customer. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] was not found. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise returns an error.", + "canonical": true, + "file": "cloud_channel_service.get_customer_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.CustomerRepricingConfig", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "GetCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListCustomerRepricingConfigs_async", + "title": "CloudChannelReportsService listCustomerRepricingConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists information about how a Reseller modifies their bill before sending it to a Customer. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resources. The data for each resource is displayed in the ascending order of: * customer ID * [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement] * [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] * [CustomerRepricingConfig.update_time][google.cloud.channel.v1.CustomerRepricingConfig.update_time] If unsuccessful, returns an error.", + "canonical": true, + "file": "cloud_channel_service.list_customer_repricing_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCustomerRepricingConfigs", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListCustomerRepricingConfigsResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListCustomerRepricingConfigs", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_async", + "title": "CloudChannelReportsService createCustomerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. You can only create configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. If needed, you can create a config for the current month, with some restrictions. When creating a config for a future month, make sure there are no existing configs for that [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. The following restrictions are for creating configs in the current month. * This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases. * The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours. * There is a limit of ten configs for any [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement] or [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. * The contained [CustomerRepricingConfig.repricing_config][google.cloud.channel.v1.CustomerRepricingConfig.repricing_config] vaule must be different from the value used in the current config for a [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement]. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise returns an error.", + "canonical": true, + "file": "cloud_channel_service.create_customer_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "customer_repricing_config", + "type": ".google.cloud.channel.v1.CustomerRepricingConfig" + } + ], + "resultType": ".google.cloud.channel.v1.CustomerRepricingConfig", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CreateCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateCustomerRepricingConfig_async", + "title": "CloudChannelReportsService updateCustomerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. This method overwrites the existing CustomerRepricingConfig. You can only update configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. To make changes to configs for the current month, use [CreateCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfig], taking note of its restrictions. You cannot update the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. When updating a config in the future: * This config must already exist. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise returns an error.", + "canonical": true, + "file": "cloud_channel_service.update_customer_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "customer_repricing_config", + "type": ".google.cloud.channel.v1.CustomerRepricingConfig" + } + ], + "resultType": ".google.cloud.channel.v1.CustomerRepricingConfig", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "UpdateCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_DeleteCustomerRepricingConfig_async", + "title": "CloudChannelReportsService deleteCustomerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes the given [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] permanently. You can only delete configs if their [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is set to a date after the current month. Possible error codes: * PERMISSION_DENIED: The account making the request does not own this customer. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * FAILED_PRECONDITION: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] is active or in the past. * NOT_FOUND: No [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] found for the name in the request.", + "canonical": true, + "file": "cloud_channel_service.delete_customer_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "DeleteCustomerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerRepricingConfig_async", + "title": "CloudChannelReportsService getChannelPartnerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets information about how a Distributor modifies their bill before sending it to a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] was not found. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, otherwise returns an error.", + "canonical": true, + "file": "cloud_channel_service.get_channel_partner_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ChannelPartnerRepricingConfig", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "GetChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerRepricingConfigs_async", + "title": "CloudChannelReportsService listChannelPartnerRepricingConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists information about how a Reseller modifies their bill before sending it to a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resources. The data for each resource is displayed in the ascending order of: * channel partner ID * [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] * [ChannelPartnerRepricingConfig.update_time][google.cloud.channel.v1.ChannelPartnerRepricingConfig.update_time] If unsuccessful, returns an error.", + "canonical": true, + "file": "cloud_channel_service.list_channel_partner_repricing_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChannelPartnerRepricingConfigs", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListChannelPartnerRepricingConfigs", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_async", + "title": "CloudChannelReportsService createChannelPartnerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. You can only create configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. If needed, you can create a config for the current month, with some restrictions. When creating a config for a future month, make sure there are no existing configs for that [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. The following restrictions are for creating configs in the current month. * This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases. * The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours. * There is a limit of ten configs for any ChannelPartner or [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. * The contained [ChannelPartnerRepricingConfig.repricing_config][google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config] vaule must be different from the value used in the current config for a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, otherwise returns an error.", + "canonical": true, + "file": "cloud_channel_service.create_channel_partner_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "channel_partner_repricing_config", + "type": ".google.cloud.channel.v1.ChannelPartnerRepricingConfig" + } + ], + "resultType": ".google.cloud.channel.v1.ChannelPartnerRepricingConfig", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "CreateChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerRepricingConfig_async", + "title": "CloudChannelReportsService updateChannelPartnerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. This method overwrites the existing CustomerRepricingConfig. You can only update configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. To make changes to configs for the current month, use [CreateChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfig], taking note of its restrictions. You cannot update the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. When updating a config in the future: * This config must already exist. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, otherwise returns an error.", + "canonical": true, + "file": "cloud_channel_service.update_channel_partner_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "channel_partner_repricing_config", + "type": ".google.cloud.channel.v1.ChannelPartnerRepricingConfig" + } + ], + "resultType": ".google.cloud.channel.v1.ChannelPartnerRepricingConfig", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "UpdateChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_DeleteChannelPartnerRepricingConfig_async", + "title": "CloudChannelReportsService deleteChannelPartnerRepricingConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes the given [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] permanently. You can only delete configs if their [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is set to a date after the current month. Possible error codes: * PERMISSION_DENIED: The account making the request does not own this customer. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * FAILED_PRECONDITION: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] is active or in the past. * NOT_FOUND: No [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] found for the name in the request.", + "canonical": true, + "file": "cloud_channel_service.delete_channel_partner_repricing_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.DeleteChannelPartnerRepricingConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "DeleteChannelPartnerRepricingConfig", + "fullName": "google.cloud.channel.v1.CloudChannelService.DeleteChannelPartnerRepricingConfig", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_LookupOffer_async", + "title": "CloudChannelReportsService lookupOffer Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested [Offer][google.cloud.channel.v1.Offer] resource. Possible error codes: * PERMISSION_DENIED: The entitlement doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement or offer was not found. Return value: The [Offer][google.cloud.channel.v1.Offer] resource.", + "canonical": true, + "file": "cloud_channel_service.lookup_offer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LookupOffer", + "fullName": "google.cloud.channel.v1.CloudChannelService.LookupOffer", + "async": true, + "parameters": [ + { + "name": "entitlement", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.Offer", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "LookupOffer", + "fullName": "google.cloud.channel.v1.CloudChannelService.LookupOffer", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListProducts_async", + "title": "CloudChannelReportsService listProducts Sample", + "origin": "API_DEFINITION", + "description": " Lists the Products the reseller is authorized to sell. Possible error codes: * INVALID_ARGUMENT: Required request parameters are missing or invalid.", + "canonical": true, + "file": "cloud_channel_service.list_products.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProducts", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListProducts", + "async": true, + "parameters": [ + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListProductsResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListProducts", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListProducts", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListSkus_async", + "title": "CloudChannelReportsService listSkus Sample", + "origin": "API_DEFINITION", + "description": " Lists the SKUs for a product the reseller is authorized to sell. Possible error codes: * INVALID_ARGUMENT: Required request parameters are missing or invalid.", + "canonical": true, + "file": "cloud_channel_service.list_skus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSkus", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListSkus", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListSkusResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListSkus", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListSkus", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListOffers_async", + "title": "CloudChannelReportsService listOffers Sample", + "origin": "API_DEFINITION", + "description": " Lists the Offers the reseller can sell. Possible error codes: * INVALID_ARGUMENT: Required request parameters are missing or invalid.", + "canonical": true, + "file": "cloud_channel_service.list_offers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOffers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListOffers", + "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": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListOffersResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListOffers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListOffers", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async", + "title": "CloudChannelReportsService listPurchasableSkus Sample", + "origin": "API_DEFINITION", + "description": " Lists the following: * SKUs that you can purchase for a customer * SKUs that you can upgrade or downgrade for an entitlement. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid.", + "canonical": true, + "file": "cloud_channel_service.list_purchasable_skus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPurchasableSkus", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListPurchasableSkus", + "async": true, + "parameters": [ + { + "name": "create_entitlement_purchase", + "type": ".google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase" + }, + { + "name": "change_offer_purchase", + "type": ".google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase" + }, + { + "name": "customer", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListPurchasableSkusResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListPurchasableSkus", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListPurchasableSkus", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async", + "title": "CloudChannelReportsService listPurchasableOffers Sample", + "origin": "API_DEFINITION", + "description": " Lists the following: * Offers that you can purchase for a customer. * Offers that you can change for an entitlement. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller * INVALID_ARGUMENT: Required request parameters are missing or invalid.", + "canonical": true, + "file": "cloud_channel_service.list_purchasable_offers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPurchasableOffers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListPurchasableOffers", + "async": true, + "parameters": [ + { + "name": "create_entitlement_purchase", + "type": ".google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase" + }, + { + "name": "change_offer_purchase", + "type": ".google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase" + }, + { + "name": "customer", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListPurchasableOffersResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListPurchasableOffers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListPurchasableOffers", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async", + "title": "CloudChannelReportsService registerSubscriber Sample", + "origin": "API_DEFINITION", + "description": " Registers a service account with subscriber privileges on the Cloud Pub/Sub topic for this Channel Services account. After you create a subscriber, you get the events through [SubscriberEvent][google.cloud.channel.v1.SubscriberEvent] Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The topic name with the registered service email address.", + "canonical": true, + "file": "cloud_channel_service.register_subscriber.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RegisterSubscriber", + "fullName": "google.cloud.channel.v1.CloudChannelService.RegisterSubscriber", + "async": true, + "parameters": [ + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "service_account", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.RegisterSubscriberResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "RegisterSubscriber", + "fullName": "google.cloud.channel.v1.CloudChannelService.RegisterSubscriber", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async", + "title": "CloudChannelReportsService unregisterSubscriber Sample", + "origin": "API_DEFINITION", + "description": " Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. If there are no service accounts left with subscriber privileges, this deletes the topic. You can call ListSubscribers to check for these accounts. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The topic name that unregistered the service email address. Returns a success response if the service email address wasn't registered with the topic.", + "canonical": true, + "file": "cloud_channel_service.unregister_subscriber.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UnregisterSubscriber", + "fullName": "google.cloud.channel.v1.CloudChannelService.UnregisterSubscriber", + "async": true, + "parameters": [ + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "service_account", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.UnregisterSubscriberResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "UnregisterSubscriber", + "fullName": "google.cloud.channel.v1.CloudChannelService.UnregisterSubscriber", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async", + "title": "CloudChannelReportsService listSubscribers Sample", + "origin": "API_DEFINITION", + "description": " Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: A list of service email addresses.", + "canonical": true, + "file": "cloud_channel_service.list_subscribers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSubscribers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListSubscribers", + "async": true, + "parameters": [ + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.channel.v1.ListSubscribersResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "ListSubscribers", + "fullName": "google.cloud.channel.v1.CloudChannelService.ListSubscribers", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-channel/samples/package.json b/packages/google-cloud-channel/samples/package.json new file mode 100644 index 00000000000..8d804bab3cf --- /dev/null +++ b/packages/google-cloud-channel/samples/package.json @@ -0,0 +1,28 @@ +{ + "name": "nodejs-channel", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/channel": "^2.2.0", + "@google-cloud/local-auth": "^2.0.0", + "google-auth-library": "^7.0.0", + "google-gax": "^2.10.0", + "open": "^8.0.0", + "server-destroy": "^1.0.1" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-channel/samples/quickstart.js b/packages/google-cloud-channel/samples/quickstart.js new file mode 100644 index 00000000000..76da4681031 --- /dev/null +++ b/packages/google-cloud-channel/samples/quickstart.js @@ -0,0 +1,136 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 {OAuth2Client} = require('google-auth-library'); +const {grpc} = require('google-gax'); +const http = require('http'); +const url = require('url'); +const open = require('open'); +const destroyer = require('server-destroy'); + +// [START nodejs_channel_quickstart] +// Reads the secrets from a `oauth2.keys.json` file, which should be downloaded +// from the Google Developers Console and saved in the same directory with the +// sample app. + +// This sample app only calls read-only methods from the Channel API. Include +// additional scopes if calling methods that modify the configuration. +const SCOPES = ['https://www.googleapis.com/auth/apps.order']; + +async function listCustomers(authClient, accountNumber) { + // Imports the Google Cloud client library + const {CloudChannelServiceClient} = require('@google-cloud/channel'); + + // Instantiates a client using OAuth2 credentials. + const sslCreds = grpc.credentials.createSsl(); + const credentials = grpc.credentials.combineChannelCredentials( + sslCreds, + grpc.credentials.createFromGoogleCredential(authClient) + ); + + // Instantiates a client + const client = new CloudChannelServiceClient({ + sslCreds: credentials, + }); + + // Calls listCustomers() method + const customers = await client.listCustomers({ + parent: `accounts/${accountNumber}`, + }); + console.info(customers); +} + +/** + * Create a new OAuth2Client, and go through the OAuth2 content + * workflow. Return the full client to the callback. + */ +function getAuthenticatedClient(keys) { + return new Promise((resolve, reject) => { + // Create an oAuth client to authorize the API call. Secrets are kept in a + // `keys.json` file, which should be downloaded from the Google Developers + // Console. + const oAuth2Client = new OAuth2Client( + keys.web.client_id, + keys.web.client_secret, + // The first redirect URL from the `oauth2.keys.json` file will be used + // to generate the OAuth2 callback URL. Update the line below or edit + // the redirect URL in the Google Developers Console if needed. + // This sample app expects the callback URL to be + // 'http://localhost:3000/oauth2callback' + keys.web.redirect_uris[0] + ); + + // Generate the url that will be used for the consent dialog. + const authorizeUrl = oAuth2Client.generateAuthUrl({ + access_type: 'offline', + scope: SCOPES.join(' '), + }); + + // Open an http server to accept the oauth callback. In this example, the + // only request to our webserver is to /oauth2callback?code= + const server = http + .createServer(async (req, res) => { + try { + if (req.url.indexOf('/oauth2callback') > -1) { + // Acquire the code from the querystring, and close the web + // server. + const qs = new url.URL(req.url, 'http://localhost:3000') + .searchParams; + const code = qs.get('code'); + console.log(`Code is ${code}`); + res.end('Authentication successful! Please return to the console.'); + server.destroy(); + + // Now that we have the code, use that to acquire tokens. + const r = await oAuth2Client.getToken(code); + // Make sure to set the credentials on the OAuth2 client. + oAuth2Client.setCredentials(r.tokens); + console.info('Tokens acquired.'); + resolve(oAuth2Client); + } + } catch (e) { + reject(e); + } + }) + .listen(3000, () => { + // Open the browser to the authorize url to start the workflow. + // This line will not work if you are running the code in the + // environment where a browser is not available. In this case, + // copy the URL and open it manually in a browser. + console.info(`Opening the browser with URL: ${authorizeUrl}`); + open(authorizeUrl, {wait: false}).then(cp => cp.unref()); + }); + destroyer(server); + }); +} + +async function main(accountNumber, keys) { + // TODO: uncomment with your account number + // const accountNumber = '1234' + + // TODO: uncomment this line with your oAuth2 file + //const keys = require('./oauth2.keys.json'); + + getAuthenticatedClient(keys).then(authClient => + listCustomers(authClient, accountNumber) + ); +} +// [END nodejs_channel_quickstart] + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-channel/samples/test/quickstart.js b/packages/google-cloud-channel/samples/test/quickstart.js new file mode 100644 index 00000000000..ed45517a1a8 --- /dev/null +++ b/packages/google-cloud-channel/samples/test/quickstart.js @@ -0,0 +1,37 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + it('should run quickstart', async () => { + try { + execSync('node ./quickstart.js 1234', {cwd}); + } catch (err) { + assert.match(err.message, /Cannot read property 'web' of undefined/); + } + }); +}); diff --git a/packages/google-cloud-channel/src/index.ts b/packages/google-cloud-channel/src/index.ts new file mode 100644 index 00000000000..16118e52a2d --- /dev/null +++ b/packages/google-cloud-channel/src/index.ts @@ -0,0 +1,33 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const CloudChannelReportsServiceClient = v1.CloudChannelReportsServiceClient; +type CloudChannelReportsServiceClient = v1.CloudChannelReportsServiceClient; +const CloudChannelServiceClient = v1.CloudChannelServiceClient; +type CloudChannelServiceClient = v1.CloudChannelServiceClient; + +export {v1, CloudChannelReportsServiceClient, CloudChannelServiceClient}; +export default { + v1, + CloudChannelReportsServiceClient, + CloudChannelServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts new file mode 100644 index 00000000000..d0eb86dbe62 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts @@ -0,0 +1,1671 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cloud_channel_reports_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_channel_reports_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * CloudChannelReportsService lets Google Cloud resellers and + * distributors retrieve and combine a variety of data in Cloud Channel for + * multiple products (Google Cloud Platform (GCP), Google Voice, and + * Google Workspace.) + * @class + * @memberof v1 + */ +export class CloudChannelReportsServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudChannelReportsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudChannelReportsServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CloudChannelReportsServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof CloudChannelReportsServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + channelPartnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/channelPartnerLinks/{channel_partner_link}' + ), + channelPartnerRepricingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}' + ), + customerPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/customers/{customer}' + ), + customerRepricingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}' + ), + entitlementPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/customers/{customer}/entitlements/{entitlement}' + ), + offerPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/offers/{offer}' + ), + productPathTemplate: new this._gaxModule.PathTemplate( + 'products/{product}' + ), + reportPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/reports/{report}' + ), + reportJobPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/reportJobs/{report_job}' + ), + skuPathTemplate: new this._gaxModule.PathTemplate( + 'products/{product}/skus/{sku}' + ), + }; + + // 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 = { + fetchReportResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'rows' + ), + listReports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'reports' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=operations/**}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=operations}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const runReportJobResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.RunReportJobResponse' + ) as gax.protobuf.Type; + const runReportJobMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + runReportJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runReportJobResponse.decode.bind(runReportJobResponse), + runReportJobMetadata.decode.bind(runReportJobMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.channel.v1.CloudChannelReportsService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.cloudChannelReportsServiceStub) { + return this.cloudChannelReportsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.channel.v1.CloudChannelReportsService. + this.cloudChannelReportsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.channel.v1.CloudChannelReportsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.channel.v1 + .CloudChannelReportsService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const cloudChannelReportsServiceStubMethods = [ + 'runReportJob', + 'fetchReportResults', + 'listReports', + ]; + for (const methodName of cloudChannelReportsServiceStubMethods) { + const callPromise = this.cloudChannelReportsServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudChannelReportsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudchannel.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudchannel.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/apps.reports.usage.readonly']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Begins generation of data for a given report. The report + * identifier is a UID (for example, `613bf59q`). + * + * Possible error codes: + * + * * PERMISSION_DENIED: The user doesn't have access to this report. + * * INVALID_ARGUMENT: Required request parameters are missing + * or invalid. + * * NOT_FOUND: The report identifier was not found. + * * INTERNAL: Any non-user error related to a technical issue + * in the backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue + * in the backend. Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata contains an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * To get the results of report generation, call + * {@link google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults|CloudChannelReportsService.FetchReportResults} with the + * {@link google.cloud.channel.v1.RunReportJobResponse.report_job|RunReportJobResponse.report_job}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The report's resource name. Specifies the account and report used to + * generate report data. The report_id identifier is a UID (for example, + * `613bf59q`). + * Name uses the format: + * accounts/{account_id}/reports/{report_id} + * @param {google.cloud.channel.v1.DateRange} [request.dateRange] + * Optional. The range of usage or invoice dates to include in the result. + * @param {string} [request.filter] + * Optional. A structured string that defines conditions on dimension columns to + * restrict the report output. + * + * Filters support logical operators (AND, OR, NOT) and conditional operators + * (=, !=, <, >, <=, and >=) using `column_id` as keys. + * + * For example: + * `(customer:"accounts/C123abc/customers/S456def" OR + * customer:"accounts/C123abc/customers/S789ghi") AND + * invoice_start_date.year >= 2022` + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US". If specified, the + * response is localized to the corresponding language code if the + * original data sources support it. + * Default is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_reports_service.run_report_job.js + * region_tag:cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_async + */ + runReportJob( + request?: protos.google.cloud.channel.v1.IRunReportJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runReportJob( + request: protos.google.cloud.channel.v1.IRunReportJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runReportJob( + request: protos.google.cloud.channel.v1.IRunReportJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runReportJob( + request?: protos.google.cloud.channel.v1.IRunReportJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.runReportJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runReportJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_reports_service.run_report_job.js + * region_tag:cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_async + */ + async checkRunReportJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.RunReportJobResponse, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.runReportJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.RunReportJobResponse, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Retrieves data generated by {@link google.cloud.channel.v1.CloudChannelReportsService.RunReportJob|CloudChannelReportsService.RunReportJob}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.reportJob + * Required. The report job created by {@link google.cloud.channel.v1.CloudChannelReportsService.RunReportJob|CloudChannelReportsService.RunReportJob}. + * Report_job uses the format: + * accounts/{account_id}/reportJobs/{report_job_id} + * @param {number} [request.pageSize] + * Optional. Requested page size of the report. The server may return fewer results than + * requested. If you don't specify a page size, the server uses a sensible + * default (may change over time). + * + * The maximum value is 30,000; the server will change larger values to + * 30,000. + * @param {string} [request.pageToken] + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.FetchReportResultsResponse.next_page_token|FetchReportResultsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults|CloudChannelReportsService.FetchReportResults} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Row]{@link google.cloud.channel.v1.Row}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `fetchReportResultsAsync()` + * 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. + */ + fetchReportResults( + request?: protos.google.cloud.channel.v1.IFetchReportResultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IRow[], + protos.google.cloud.channel.v1.IFetchReportResultsRequest | null, + protos.google.cloud.channel.v1.IFetchReportResultsResponse + ] + >; + fetchReportResults( + request: protos.google.cloud.channel.v1.IFetchReportResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IFetchReportResultsRequest, + | protos.google.cloud.channel.v1.IFetchReportResultsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IRow + > + ): void; + fetchReportResults( + request: protos.google.cloud.channel.v1.IFetchReportResultsRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IFetchReportResultsRequest, + | protos.google.cloud.channel.v1.IFetchReportResultsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IRow + > + ): void; + fetchReportResults( + request?: protos.google.cloud.channel.v1.IFetchReportResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IFetchReportResultsRequest, + | protos.google.cloud.channel.v1.IFetchReportResultsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IRow + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IFetchReportResultsRequest, + | protos.google.cloud.channel.v1.IFetchReportResultsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IRow + > + ): Promise< + [ + protos.google.cloud.channel.v1.IRow[], + protos.google.cloud.channel.v1.IFetchReportResultsRequest | null, + protos.google.cloud.channel.v1.IFetchReportResultsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + report_job: request.reportJob ?? '', + }); + this.initialize(); + return this.innerApiCalls.fetchReportResults(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.reportJob + * Required. The report job created by {@link google.cloud.channel.v1.CloudChannelReportsService.RunReportJob|CloudChannelReportsService.RunReportJob}. + * Report_job uses the format: + * accounts/{account_id}/reportJobs/{report_job_id} + * @param {number} [request.pageSize] + * Optional. Requested page size of the report. The server may return fewer results than + * requested. If you don't specify a page size, the server uses a sensible + * default (may change over time). + * + * The maximum value is 30,000; the server will change larger values to + * 30,000. + * @param {string} [request.pageToken] + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.FetchReportResultsResponse.next_page_token|FetchReportResultsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults|CloudChannelReportsService.FetchReportResults} call. + * @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 [Row]{@link google.cloud.channel.v1.Row} 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 `fetchReportResultsAsync()` + * 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. + */ + fetchReportResultsStream( + request?: protos.google.cloud.channel.v1.IFetchReportResultsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + report_job: request.reportJob ?? '', + }); + const defaultCallSettings = this._defaults['fetchReportResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchReportResults.createStream( + this.innerApiCalls.fetchReportResults as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `fetchReportResults`, 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.reportJob + * Required. The report job created by {@link google.cloud.channel.v1.CloudChannelReportsService.RunReportJob|CloudChannelReportsService.RunReportJob}. + * Report_job uses the format: + * accounts/{account_id}/reportJobs/{report_job_id} + * @param {number} [request.pageSize] + * Optional. Requested page size of the report. The server may return fewer results than + * requested. If you don't specify a page size, the server uses a sensible + * default (may change over time). + * + * The maximum value is 30,000; the server will change larger values to + * 30,000. + * @param {string} [request.pageToken] + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.FetchReportResultsResponse.next_page_token|FetchReportResultsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults|CloudChannelReportsService.FetchReportResults} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Row]{@link google.cloud.channel.v1.Row}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js + * region_tag:cloudchannel_v1_generated_CloudChannelReportsService_FetchReportResults_async + */ + fetchReportResultsAsync( + request?: protos.google.cloud.channel.v1.IFetchReportResultsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + report_job: request.reportJob ?? '', + }); + const defaultCallSettings = this._defaults['fetchReportResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchReportResults.asyncIterate( + this.innerApiCalls['fetchReportResults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the reports that RunReportJob can run. These reports include an ID, + * a description, and the list of columns that will be in the result. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the partner account to list available reports for. + * Parent uses the format: + * accounts/{account_id} + * @param {number} [request.pageSize] + * Optional. Requested page size of the report. The server might return fewer results + * than requested. If unspecified, returns 20 reports. + * The maximum value is 100. + * @param {string} [request.pageToken] + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListReportsResponse.next_page_token|ListReportsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelReportsService.ListReports|CloudChannelReportsService.ListReports} call. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US". If specified, the + * response is localized to the corresponding language code if the + * original data sources support it. + * Default is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Report]{@link google.cloud.channel.v1.Report}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listReportsAsync()` + * 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. + */ + listReports( + request?: protos.google.cloud.channel.v1.IListReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IReport[], + protos.google.cloud.channel.v1.IListReportsRequest | null, + protos.google.cloud.channel.v1.IListReportsResponse + ] + >; + listReports( + request: protos.google.cloud.channel.v1.IListReportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListReportsRequest, + protos.google.cloud.channel.v1.IListReportsResponse | null | undefined, + protos.google.cloud.channel.v1.IReport + > + ): void; + listReports( + request: protos.google.cloud.channel.v1.IListReportsRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListReportsRequest, + protos.google.cloud.channel.v1.IListReportsResponse | null | undefined, + protos.google.cloud.channel.v1.IReport + > + ): void; + listReports( + request?: protos.google.cloud.channel.v1.IListReportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListReportsRequest, + | protos.google.cloud.channel.v1.IListReportsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IReport + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListReportsRequest, + protos.google.cloud.channel.v1.IListReportsResponse | null | undefined, + protos.google.cloud.channel.v1.IReport + > + ): Promise< + [ + protos.google.cloud.channel.v1.IReport[], + protos.google.cloud.channel.v1.IListReportsRequest | null, + protos.google.cloud.channel.v1.IListReportsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listReports(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the partner account to list available reports for. + * Parent uses the format: + * accounts/{account_id} + * @param {number} [request.pageSize] + * Optional. Requested page size of the report. The server might return fewer results + * than requested. If unspecified, returns 20 reports. + * The maximum value is 100. + * @param {string} [request.pageToken] + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListReportsResponse.next_page_token|ListReportsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelReportsService.ListReports|CloudChannelReportsService.ListReports} call. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US". If specified, the + * response is localized to the corresponding language code if the + * original data sources support it. + * Default is "en-US". + * @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 [Report]{@link google.cloud.channel.v1.Report} 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 `listReportsAsync()` + * 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. + */ + listReportsStream( + request?: protos.google.cloud.channel.v1.IListReportsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReports.createStream( + this.innerApiCalls.listReports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReports`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the partner account to list available reports for. + * Parent uses the format: + * accounts/{account_id} + * @param {number} [request.pageSize] + * Optional. Requested page size of the report. The server might return fewer results + * than requested. If unspecified, returns 20 reports. + * The maximum value is 100. + * @param {string} [request.pageToken] + * Optional. A token that specifies a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListReportsResponse.next_page_token|ListReportsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelReportsService.ListReports|CloudChannelReportsService.ListReports} call. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code, such as "en-US". If specified, the + * response is localized to the corresponding language code if the + * original data sources support it. + * Default is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Report]{@link google.cloud.channel.v1.Report}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_reports_service.list_reports.js + * region_tag:cloudchannel_v1_generated_CloudChannelReportsService_ListReports_async + */ + listReportsAsync( + request?: protos.google.cloud.channel.v1.IListReportsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReports.asyncIterate( + this.innerApiCalls['listReports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified channelPartnerLink resource name string. + * + * @param {string} account + * @param {string} channel_partner_link + * @returns {string} Resource name string. + */ + channelPartnerLinkPath(account: string, channelPartnerLink: string) { + return this.pathTemplates.channelPartnerLinkPathTemplate.render({ + account: account, + channel_partner_link: channelPartnerLink, + }); + } + + /** + * Parse the account from ChannelPartnerLink resource. + * + * @param {string} channelPartnerLinkName + * A fully-qualified path representing ChannelPartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromChannelPartnerLinkName(channelPartnerLinkName: string) { + return this.pathTemplates.channelPartnerLinkPathTemplate.match( + channelPartnerLinkName + ).account; + } + + /** + * Parse the channel_partner_link from ChannelPartnerLink resource. + * + * @param {string} channelPartnerLinkName + * A fully-qualified path representing ChannelPartnerLink resource. + * @returns {string} A string representing the channel_partner_link. + */ + matchChannelPartnerLinkFromChannelPartnerLinkName( + channelPartnerLinkName: string + ) { + return this.pathTemplates.channelPartnerLinkPathTemplate.match( + channelPartnerLinkName + ).channel_partner_link; + } + + /** + * Return a fully-qualified channelPartnerRepricingConfig resource name string. + * + * @param {string} account + * @param {string} channel_partner + * @param {string} channel_partner_repricing_config + * @returns {string} Resource name string. + */ + channelPartnerRepricingConfigPath( + account: string, + channelPartner: string, + channelPartnerRepricingConfig: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.render({ + account: account, + channel_partner: channelPartner, + channel_partner_repricing_config: channelPartnerRepricingConfig, + }); + } + + /** + * Parse the account from ChannelPartnerRepricingConfig resource. + * + * @param {string} channelPartnerRepricingConfigName + * A fully-qualified path representing ChannelPartnerRepricingConfig resource. + * @returns {string} A string representing the account. + */ + matchAccountFromChannelPartnerRepricingConfigName( + channelPartnerRepricingConfigName: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.match( + channelPartnerRepricingConfigName + ).account; + } + + /** + * Parse the channel_partner from ChannelPartnerRepricingConfig resource. + * + * @param {string} channelPartnerRepricingConfigName + * A fully-qualified path representing ChannelPartnerRepricingConfig resource. + * @returns {string} A string representing the channel_partner. + */ + matchChannelPartnerFromChannelPartnerRepricingConfigName( + channelPartnerRepricingConfigName: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.match( + channelPartnerRepricingConfigName + ).channel_partner; + } + + /** + * Parse the channel_partner_repricing_config from ChannelPartnerRepricingConfig resource. + * + * @param {string} channelPartnerRepricingConfigName + * A fully-qualified path representing ChannelPartnerRepricingConfig resource. + * @returns {string} A string representing the channel_partner_repricing_config. + */ + matchChannelPartnerRepricingConfigFromChannelPartnerRepricingConfigName( + channelPartnerRepricingConfigName: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.match( + channelPartnerRepricingConfigName + ).channel_partner_repricing_config; + } + + /** + * Return a fully-qualified customer resource name string. + * + * @param {string} account + * @param {string} customer + * @returns {string} Resource name string. + */ + customerPath(account: string, customer: string) { + return this.pathTemplates.customerPathTemplate.render({ + account: account, + customer: customer, + }); + } + + /** + * Parse the account from Customer resource. + * + * @param {string} customerName + * A fully-qualified path representing Customer resource. + * @returns {string} A string representing the account. + */ + matchAccountFromCustomerName(customerName: string) { + return this.pathTemplates.customerPathTemplate.match(customerName).account; + } + + /** + * Parse the customer from Customer resource. + * + * @param {string} customerName + * A fully-qualified path representing Customer resource. + * @returns {string} A string representing the customer. + */ + matchCustomerFromCustomerName(customerName: string) { + return this.pathTemplates.customerPathTemplate.match(customerName).customer; + } + + /** + * Return a fully-qualified customerRepricingConfig resource name string. + * + * @param {string} account + * @param {string} customer + * @param {string} customer_repricing_config + * @returns {string} Resource name string. + */ + customerRepricingConfigPath( + account: string, + customer: string, + customerRepricingConfig: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.render({ + account: account, + customer: customer, + customer_repricing_config: customerRepricingConfig, + }); + } + + /** + * Parse the account from CustomerRepricingConfig resource. + * + * @param {string} customerRepricingConfigName + * A fully-qualified path representing CustomerRepricingConfig resource. + * @returns {string} A string representing the account. + */ + matchAccountFromCustomerRepricingConfigName( + customerRepricingConfigName: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.match( + customerRepricingConfigName + ).account; + } + + /** + * Parse the customer from CustomerRepricingConfig resource. + * + * @param {string} customerRepricingConfigName + * A fully-qualified path representing CustomerRepricingConfig resource. + * @returns {string} A string representing the customer. + */ + matchCustomerFromCustomerRepricingConfigName( + customerRepricingConfigName: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.match( + customerRepricingConfigName + ).customer; + } + + /** + * Parse the customer_repricing_config from CustomerRepricingConfig resource. + * + * @param {string} customerRepricingConfigName + * A fully-qualified path representing CustomerRepricingConfig resource. + * @returns {string} A string representing the customer_repricing_config. + */ + matchCustomerRepricingConfigFromCustomerRepricingConfigName( + customerRepricingConfigName: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.match( + customerRepricingConfigName + ).customer_repricing_config; + } + + /** + * Return a fully-qualified entitlement resource name string. + * + * @param {string} account + * @param {string} customer + * @param {string} entitlement + * @returns {string} Resource name string. + */ + entitlementPath(account: string, customer: string, entitlement: string) { + return this.pathTemplates.entitlementPathTemplate.render({ + account: account, + customer: customer, + entitlement: entitlement, + }); + } + + /** + * Parse the account from Entitlement resource. + * + * @param {string} entitlementName + * A fully-qualified path representing Entitlement resource. + * @returns {string} A string representing the account. + */ + matchAccountFromEntitlementName(entitlementName: string) { + return this.pathTemplates.entitlementPathTemplate.match(entitlementName) + .account; + } + + /** + * Parse the customer from Entitlement resource. + * + * @param {string} entitlementName + * A fully-qualified path representing Entitlement resource. + * @returns {string} A string representing the customer. + */ + matchCustomerFromEntitlementName(entitlementName: string) { + return this.pathTemplates.entitlementPathTemplate.match(entitlementName) + .customer; + } + + /** + * Parse the entitlement from Entitlement resource. + * + * @param {string} entitlementName + * A fully-qualified path representing Entitlement resource. + * @returns {string} A string representing the entitlement. + */ + matchEntitlementFromEntitlementName(entitlementName: string) { + return this.pathTemplates.entitlementPathTemplate.match(entitlementName) + .entitlement; + } + + /** + * Return a fully-qualified offer resource name string. + * + * @param {string} account + * @param {string} offer + * @returns {string} Resource name string. + */ + offerPath(account: string, offer: string) { + return this.pathTemplates.offerPathTemplate.render({ + account: account, + offer: offer, + }); + } + + /** + * Parse the account from Offer resource. + * + * @param {string} offerName + * A fully-qualified path representing Offer resource. + * @returns {string} A string representing the account. + */ + matchAccountFromOfferName(offerName: string) { + return this.pathTemplates.offerPathTemplate.match(offerName).account; + } + + /** + * Parse the offer from Offer resource. + * + * @param {string} offerName + * A fully-qualified path representing Offer resource. + * @returns {string} A string representing the offer. + */ + matchOfferFromOfferName(offerName: string) { + return this.pathTemplates.offerPathTemplate.match(offerName).offer; + } + + /** + * Return a fully-qualified product resource name string. + * + * @param {string} product + * @returns {string} Resource name string. + */ + productPath(product: string) { + return this.pathTemplates.productPathTemplate.render({ + product: product, + }); + } + + /** + * Parse the product from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the product. + */ + matchProductFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).product; + } + + /** + * Return a fully-qualified report resource name string. + * + * @param {string} account + * @param {string} report + * @returns {string} Resource name string. + */ + reportPath(account: string, report: string) { + return this.pathTemplates.reportPathTemplate.render({ + account: account, + report: report, + }); + } + + /** + * Parse the account from Report resource. + * + * @param {string} reportName + * A fully-qualified path representing Report resource. + * @returns {string} A string representing the account. + */ + matchAccountFromReportName(reportName: string) { + return this.pathTemplates.reportPathTemplate.match(reportName).account; + } + + /** + * Parse the report from Report resource. + * + * @param {string} reportName + * A fully-qualified path representing Report resource. + * @returns {string} A string representing the report. + */ + matchReportFromReportName(reportName: string) { + return this.pathTemplates.reportPathTemplate.match(reportName).report; + } + + /** + * Return a fully-qualified reportJob resource name string. + * + * @param {string} account + * @param {string} report_job + * @returns {string} Resource name string. + */ + reportJobPath(account: string, reportJob: string) { + return this.pathTemplates.reportJobPathTemplate.render({ + account: account, + report_job: reportJob, + }); + } + + /** + * Parse the account from ReportJob resource. + * + * @param {string} reportJobName + * A fully-qualified path representing ReportJob resource. + * @returns {string} A string representing the account. + */ + matchAccountFromReportJobName(reportJobName: string) { + return this.pathTemplates.reportJobPathTemplate.match(reportJobName) + .account; + } + + /** + * Parse the report_job from ReportJob resource. + * + * @param {string} reportJobName + * A fully-qualified path representing ReportJob resource. + * @returns {string} A string representing the report_job. + */ + matchReportJobFromReportJobName(reportJobName: string) { + return this.pathTemplates.reportJobPathTemplate.match(reportJobName) + .report_job; + } + + /** + * Return a fully-qualified sku resource name string. + * + * @param {string} product + * @param {string} sku + * @returns {string} Resource name string. + */ + skuPath(product: string, sku: string) { + return this.pathTemplates.skuPathTemplate.render({ + product: product, + sku: sku, + }); + } + + /** + * Parse the product from Sku resource. + * + * @param {string} skuName + * A fully-qualified path representing Sku resource. + * @returns {string} A string representing the product. + */ + matchProductFromSkuName(skuName: string) { + return this.pathTemplates.skuPathTemplate.match(skuName).product; + } + + /** + * Parse the sku from Sku resource. + * + * @param {string} skuName + * A fully-qualified path representing Sku resource. + * @returns {string} A string representing the sku. + */ + matchSkuFromSkuName(skuName: string) { + return this.pathTemplates.skuPathTemplate.match(skuName).sku; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.cloudChannelReportsServiceStub && !this._terminated) { + return this.cloudChannelReportsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client_config.json b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client_config.json new file mode 100644 index 00000000000..c3db1fd9619 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.channel.v1.CloudChannelReportsService": { + "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": { + "RunReportJob": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchReportResults": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReports": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json new file mode 100644 index 00000000000..aff1dcc4ca3 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/channel/v1/channel_partner_links.proto", + "../../protos/google/cloud/channel/v1/common.proto", + "../../protos/google/cloud/channel/v1/customers.proto", + "../../protos/google/cloud/channel/v1/entitlements.proto", + "../../protos/google/cloud/channel/v1/offers.proto", + "../../protos/google/cloud/channel/v1/operations.proto", + "../../protos/google/cloud/channel/v1/products.proto", + "../../protos/google/cloud/channel/v1/reports_service.proto", + "../../protos/google/cloud/channel/v1/repricing.proto", + "../../protos/google/cloud/channel/v1/service.proto", + "../../protos/google/cloud/channel/v1/subscriber_event.proto" +] diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts new file mode 100644 index 00000000000..d75630c36be --- /dev/null +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts @@ -0,0 +1,8727 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cloud_channel_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_channel_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * CloudChannelService lets Google cloud resellers and distributors manage + * their customers, channel partners, entitlements, and reports. + * + * Using this service: + * 1. Resellers and distributors can manage a customer entity. + * 2. Distributors can register an authorized reseller in their channel and + * provide them with delegated admin access. + * 3. Resellers and distributors can manage customer entitlements. + * + * CloudChannelService exposes the following resources: + * - {@link google.cloud.channel.v1.Customer|Customer}s: An entity—usually an enterprise—managed by a reseller or + * distributor. + * + * - {@link google.cloud.channel.v1.Entitlement|Entitlement}s: An entity that provides a customer with the means to use + * a service. Entitlements are created or updated as a result of a successful + * fulfillment. + * + * - {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}s: An entity that identifies links between + * distributors and their indirect resellers in a channel. + * @class + * @memberof v1 + */ +export class CloudChannelServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudChannelServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudChannelServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CloudChannelServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof CloudChannelServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + channelPartnerLinkPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/channelPartnerLinks/{channel_partner_link}' + ), + channelPartnerRepricingConfigPathTemplate: + new this._gaxModule.PathTemplate( + 'accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}' + ), + customerPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/customers/{customer}' + ), + customerRepricingConfigPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}' + ), + entitlementPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/customers/{customer}/entitlements/{entitlement}' + ), + offerPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/offers/{offer}' + ), + productPathTemplate: new this._gaxModule.PathTemplate( + 'products/{product}' + ), + reportPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/reports/{report}' + ), + reportJobPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/reportJobs/{report_job}' + ), + skuPathTemplate: new this._gaxModule.PathTemplate( + 'products/{product}/skus/{sku}' + ), + }; + + // 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 = { + listCustomers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'customers' + ), + listEntitlements: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'entitlements' + ), + listTransferableSkus: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferableSkus' + ), + listTransferableOffers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'transferableOffers' + ), + listChannelPartnerLinks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'channelPartnerLinks' + ), + listCustomerRepricingConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'customerRepricingConfigs' + ), + listChannelPartnerRepricingConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'channelPartnerRepricingConfigs' + ), + listProducts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'products' + ), + listSkus: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'skus' + ), + listOffers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'offers' + ), + listPurchasableSkus: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'purchasableSkus' + ), + listPurchasableOffers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'purchasableOffers' + ), + listSubscribers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'serviceAccounts' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=operations/**}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=operations/**}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=operations}', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const provisionCloudIdentityResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Customer' + ) as gax.protobuf.Type; + const provisionCloudIdentityMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createEntitlementResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const createEntitlementMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const changeParametersResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const changeParametersMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const changeRenewalSettingsResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const changeRenewalSettingsMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const changeOfferResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const changeOfferMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const startPaidServiceResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const startPaidServiceMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const suspendEntitlementResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const suspendEntitlementMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const cancelEntitlementResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const cancelEntitlementMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const activateEntitlementResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.Entitlement' + ) as gax.protobuf.Type; + const activateEntitlementMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const transferEntitlementsResponse = protoFilesRoot.lookup( + '.google.cloud.channel.v1.TransferEntitlementsResponse' + ) as gax.protobuf.Type; + const transferEntitlementsMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + const transferEntitlementsToGoogleResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const transferEntitlementsToGoogleMetadata = protoFilesRoot.lookup( + '.google.cloud.channel.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + provisionCloudIdentity: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + provisionCloudIdentityResponse.decode.bind( + provisionCloudIdentityResponse + ), + provisionCloudIdentityMetadata.decode.bind( + provisionCloudIdentityMetadata + ) + ), + createEntitlement: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEntitlementResponse.decode.bind(createEntitlementResponse), + createEntitlementMetadata.decode.bind(createEntitlementMetadata) + ), + changeParameters: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + changeParametersResponse.decode.bind(changeParametersResponse), + changeParametersMetadata.decode.bind(changeParametersMetadata) + ), + changeRenewalSettings: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + changeRenewalSettingsResponse.decode.bind( + changeRenewalSettingsResponse + ), + changeRenewalSettingsMetadata.decode.bind(changeRenewalSettingsMetadata) + ), + changeOffer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + changeOfferResponse.decode.bind(changeOfferResponse), + changeOfferMetadata.decode.bind(changeOfferMetadata) + ), + startPaidService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startPaidServiceResponse.decode.bind(startPaidServiceResponse), + startPaidServiceMetadata.decode.bind(startPaidServiceMetadata) + ), + suspendEntitlement: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + suspendEntitlementResponse.decode.bind(suspendEntitlementResponse), + suspendEntitlementMetadata.decode.bind(suspendEntitlementMetadata) + ), + cancelEntitlement: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelEntitlementResponse.decode.bind(cancelEntitlementResponse), + cancelEntitlementMetadata.decode.bind(cancelEntitlementMetadata) + ), + activateEntitlement: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + activateEntitlementResponse.decode.bind(activateEntitlementResponse), + activateEntitlementMetadata.decode.bind(activateEntitlementMetadata) + ), + transferEntitlements: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + transferEntitlementsResponse.decode.bind(transferEntitlementsResponse), + transferEntitlementsMetadata.decode.bind(transferEntitlementsMetadata) + ), + transferEntitlementsToGoogle: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + transferEntitlementsToGoogleResponse.decode.bind( + transferEntitlementsToGoogleResponse + ), + transferEntitlementsToGoogleMetadata.decode.bind( + transferEntitlementsToGoogleMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.channel.v1.CloudChannelService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.cloudChannelServiceStub) { + return this.cloudChannelServiceStub; + } + + // Put together the "service stub" for + // google.cloud.channel.v1.CloudChannelService. + this.cloudChannelServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.channel.v1.CloudChannelService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.channel.v1.CloudChannelService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const cloudChannelServiceStubMethods = [ + 'listCustomers', + 'getCustomer', + 'checkCloudIdentityAccountsExist', + 'createCustomer', + 'updateCustomer', + 'deleteCustomer', + 'importCustomer', + 'provisionCloudIdentity', + 'listEntitlements', + 'listTransferableSkus', + 'listTransferableOffers', + 'getEntitlement', + 'createEntitlement', + 'changeParameters', + 'changeRenewalSettings', + 'changeOffer', + 'startPaidService', + 'suspendEntitlement', + 'cancelEntitlement', + 'activateEntitlement', + 'transferEntitlements', + 'transferEntitlementsToGoogle', + 'listChannelPartnerLinks', + 'getChannelPartnerLink', + 'createChannelPartnerLink', + 'updateChannelPartnerLink', + 'getCustomerRepricingConfig', + 'listCustomerRepricingConfigs', + 'createCustomerRepricingConfig', + 'updateCustomerRepricingConfig', + 'deleteCustomerRepricingConfig', + 'getChannelPartnerRepricingConfig', + 'listChannelPartnerRepricingConfigs', + 'createChannelPartnerRepricingConfig', + 'updateChannelPartnerRepricingConfig', + 'deleteChannelPartnerRepricingConfig', + 'lookupOffer', + 'listProducts', + 'listSkus', + 'listOffers', + 'listPurchasableSkus', + 'listPurchasableOffers', + 'registerSubscriber', + 'unregisterSubscriber', + 'listSubscribers', + ]; + for (const methodName of cloudChannelServiceStubMethods) { + const callPromise = this.cloudChannelServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudChannelServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudchannel.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudchannel.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/apps.order']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns the requested {@link google.cloud.channel.v1.Customer|Customer} resource. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The customer resource doesn't exist. Usually the result of an + * invalid name parameter. + * + * Return value: + * The {@link google.cloud.channel.v1.Customer|Customer} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the customer to retrieve. + * Name uses the format: accounts/{account_id}/customers/{customer_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Customer]{@link google.cloud.channel.v1.Customer}. + * 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/cloud_channel_service.get_customer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_GetCustomer_async + */ + getCustomer( + request?: protos.google.cloud.channel.v1.IGetCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | undefined, + {} | undefined + ] + >; + getCustomer( + request: protos.google.cloud.channel.v1.IGetCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + getCustomer( + request: protos.google.cloud.channel.v1.IGetCustomerRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + getCustomer( + request?: protos.google.cloud.channel.v1.IGetCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getCustomer(request, options, callback); + } + /** + * Confirms the existence of Cloud Identity accounts based on the domain and + * if the Cloud Identity accounts are owned by the reseller. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * INVALID_VALUE: Invalid domain value in the request. + * + * Return value: + * A list of {@link google.cloud.channel.v1.CloudIdentityCustomerAccount|CloudIdentityCustomerAccount} resources for the domain (may be + * empty) + * + * Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if + * no {@link google.cloud.channel.v1.CloudIdentityCustomerAccount|CloudIdentityCustomerAccount} resources match the domain. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The reseller account's resource name. + * Parent uses the format: accounts/{account_id} + * @param {string} request.domain + * Required. Domain to fetch for Cloud Identity account customer. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CheckCloudIdentityAccountsExistResponse]{@link google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse}. + * 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/cloud_channel_service.check_cloud_identity_accounts_exist.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async + */ + checkCloudIdentityAccountsExist( + request?: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + ( + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | undefined + ), + {} | undefined + ] + >; + checkCloudIdentityAccountsExist( + request: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkCloudIdentityAccountsExist( + request: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | null + | undefined, + {} | null | undefined + > + ): void; + checkCloudIdentityAccountsExist( + request?: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + ( + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkCloudIdentityAccountsExist( + request, + options, + callback + ); + } + /** + * Creates a new {@link google.cloud.channel.v1.Customer|Customer} resource under the reseller or distributor + * account. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: + * * Required request parameters are missing or invalid. + * * Domain field value doesn't match the primary email domain. + * + * Return value: + * The newly created {@link google.cloud.channel.v1.Customer|Customer} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of reseller account in which to create the customer. + * Parent uses the format: accounts/{account_id} + * @param {google.cloud.channel.v1.Customer} request.customer + * Required. The customer to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Customer]{@link google.cloud.channel.v1.Customer}. + * 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/cloud_channel_service.create_customer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async + */ + createCustomer( + request?: protos.google.cloud.channel.v1.ICreateCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.ICreateCustomerRequest | undefined, + {} | undefined + ] + >; + createCustomer( + request: protos.google.cloud.channel.v1.ICreateCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + createCustomer( + request: protos.google.cloud.channel.v1.ICreateCustomerRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + createCustomer( + request?: protos.google.cloud.channel.v1.ICreateCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomer, + | protos.google.cloud.channel.v1.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.ICreateCustomerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCustomer(request, options, callback); + } + /** + * Updates an existing {@link google.cloud.channel.v1.Customer|Customer} resource for the reseller or + * distributor. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: No {@link google.cloud.channel.v1.Customer|Customer} resource found for the name in the request. + * + * Return value: + * The updated {@link google.cloud.channel.v1.Customer|Customer} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.Customer} request.customer + * Required. New contents of the customer. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask that applies to the resource. + * Optional. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Customer]{@link google.cloud.channel.v1.Customer}. + * 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/cloud_channel_service.update_customer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async + */ + updateCustomer( + request?: protos.google.cloud.channel.v1.IUpdateCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IUpdateCustomerRequest | undefined, + {} | undefined + ] + >; + updateCustomer( + request: protos.google.cloud.channel.v1.IUpdateCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IUpdateCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + updateCustomer( + request: protos.google.cloud.channel.v1.IUpdateCustomerRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IUpdateCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + updateCustomer( + request?: protos.google.cloud.channel.v1.IUpdateCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomer, + | protos.google.cloud.channel.v1.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IUpdateCustomerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IUpdateCustomerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'customer.name': request.customer!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCustomer(request, options, callback); + } + /** + * Deletes the given {@link google.cloud.channel.v1.Customer|Customer} permanently. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The account making the request does not own + * this customer. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * FAILED_PRECONDITION: The customer has existing entitlements. + * * NOT_FOUND: No {@link google.cloud.channel.v1.Customer|Customer} resource found for the name in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the customer to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.delete_customer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async + */ + deleteCustomer( + request?: protos.google.cloud.channel.v1.IDeleteCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IDeleteCustomerRequest | undefined, + {} | undefined + ] + >; + deleteCustomer( + request: protos.google.cloud.channel.v1.IDeleteCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IDeleteCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteCustomer( + request: protos.google.cloud.channel.v1.IDeleteCustomerRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IDeleteCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteCustomer( + request?: protos.google.cloud.channel.v1.IDeleteCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IDeleteCustomerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IDeleteCustomerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteCustomer(request, options, callback); + } + /** + * Imports a {@link google.cloud.channel.v1.Customer|Customer} from the Cloud Identity associated with the provided + * Cloud Identity ID or domain before a TransferEntitlements call. If a + * linked Customer already exists and overwrite_if_exists is true, it will + * update that Customer's data. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * NOT_FOUND: Cloud Identity doesn't exist or was deleted. + * * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is + * expired or invalid. + * * ALREADY_EXISTS: A customer already exists and has conflicting critical + * fields. Requires an overwrite. + * + * Return value: + * The {@link google.cloud.channel.v1.Customer|Customer}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.domain + * Required. Customer domain. + * @param {string} request.cloudIdentityId + * Required. Customer's Cloud Identity ID + * @param {string} request.parent + * Required. The resource name of the reseller's account. + * Parent takes the format: accounts/{account_id} or + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id} + * @param {string} [request.authToken] + * Optional. The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + * @param {boolean} request.overwriteIfExists + * Required. Choose to overwrite an existing customer if found. + * This must be set to true if there is an existing customer with a + * conflicting region code or domain. + * @param {string} [request.channelPartnerId] + * Optional. Cloud Identity ID of a channel partner who will be the direct reseller for + * the customer's order. This field is required for 2-tier transfer scenarios + * and can be provided via the request Parent binding as well. + * @param {string} [request.customer] + * Optional. Specifies the customer that will receive imported Cloud Identity + * information. + * Format: accounts/{account_id}/customers/{customer_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Customer]{@link google.cloud.channel.v1.Customer}. + * 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/cloud_channel_service.import_customer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async + */ + importCustomer( + request?: protos.google.cloud.channel.v1.IImportCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IImportCustomerRequest | undefined, + {} | undefined + ] + >; + importCustomer( + request: protos.google.cloud.channel.v1.IImportCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IImportCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + importCustomer( + request: protos.google.cloud.channel.v1.IImportCustomerRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IImportCustomerRequest | null | undefined, + {} | null | undefined + > + ): void; + importCustomer( + request?: protos.google.cloud.channel.v1.IImportCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomer, + | protos.google.cloud.channel.v1.IImportCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IImportCustomerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IImportCustomerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.importCustomer(request, options, callback); + } + /** + * Returns the requested {@link google.cloud.channel.v1.Entitlement|Entitlement} resource. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The customer entitlement was not found. + * + * Return value: + * The requested {@link google.cloud.channel.v1.Entitlement|Entitlement} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entitlement to retrieve. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Entitlement]{@link google.cloud.channel.v1.Entitlement}. + * 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/cloud_channel_service.get_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async + */ + getEntitlement( + request?: protos.google.cloud.channel.v1.IGetEntitlementRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IGetEntitlementRequest | undefined, + {} | undefined + ] + >; + getEntitlement( + request: protos.google.cloud.channel.v1.IGetEntitlementRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IGetEntitlementRequest | null | undefined, + {} | null | undefined + > + ): void; + getEntitlement( + request: protos.google.cloud.channel.v1.IGetEntitlementRequest, + callback: Callback< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IGetEntitlementRequest | null | undefined, + {} | null | undefined + > + ): void; + getEntitlement( + request?: protos.google.cloud.channel.v1.IGetEntitlementRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IEntitlement, + | protos.google.cloud.channel.v1.IGetEntitlementRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IGetEntitlementRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IGetEntitlementRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEntitlement(request, options, callback); + } + /** + * Returns the requested {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * You must be a distributor to call this method. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: ChannelPartnerLink resource not found because of an + * invalid channel partner link name. + * + * Return value: + * The {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the channel partner link to retrieve. + * Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} + * where {id} is the Cloud Identity ID of the partner. + * @param {google.cloud.channel.v1.ChannelPartnerLinkView} [request.view] + * Optional. The level of granularity the ChannelPartnerLink will display. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ChannelPartnerLink]{@link google.cloud.channel.v1.ChannelPartnerLink}. + * 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/cloud_channel_service.get_channel_partner_link.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async + */ + getChannelPartnerLink( + request?: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | undefined, + {} | undefined + ] + >; + getChannelPartnerLink( + request: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChannelPartnerLink( + request: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChannelPartnerLink( + request?: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getChannelPartnerLink(request, options, callback); + } + /** + * Initiates a channel partner link between a distributor and a reseller, or + * between resellers in an n-tier reseller channel. + * Invited partners need to follow the invite_link_uri provided in the + * response to accept. After accepting the invitation, a link is set up + * between the two parties. + * You must be a distributor to call this method. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * ALREADY_EXISTS: The ChannelPartnerLink sent in the request already + * exists. + * * NOT_FOUND: No Cloud Identity customer exists for provided domain. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The new {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Create a channel partner link for the provided reseller account's + * resource name. + * Parent uses the format: accounts/{account_id} + * @param {google.cloud.channel.v1.ChannelPartnerLink} request.channelPartnerLink + * Required. The channel partner link to create. + * Either channel_partner_link.reseller_cloud_identity_id or domain can be + * used to create a link. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ChannelPartnerLink]{@link google.cloud.channel.v1.ChannelPartnerLink}. + * 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/cloud_channel_service.create_channel_partner_link.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async + */ + createChannelPartnerLink( + request?: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | undefined + ), + {} | undefined + ] + >; + createChannelPartnerLink( + request: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createChannelPartnerLink( + request: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createChannelPartnerLink( + request?: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createChannelPartnerLink( + request, + options, + callback + ); + } + /** + * Updates a channel partner link. Distributors call this method to change a + * link's status. For example, to suspend a partner link. + * You must be a distributor to call this method. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: + * * Required request parameters are missing or invalid. + * * Link state cannot change from invited to active or suspended. + * * Cannot send reseller_cloud_identity_id, invite_url, or name in update + * mask. + * * NOT_FOUND: ChannelPartnerLink resource not found. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The updated {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the channel partner link to cancel. + * Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} + * where {id} is the Cloud Identity ID of the partner. + * @param {google.cloud.channel.v1.ChannelPartnerLink} request.channelPartnerLink + * Required. The channel partner link to update. Only channel_partner_link.link_state + * is allowed for updates. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask that applies to the resource. + * The only allowable value for an update mask is + * channel_partner_link.link_state. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ChannelPartnerLink]{@link google.cloud.channel.v1.ChannelPartnerLink}. + * 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/cloud_channel_service.update_channel_partner_link.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async + */ + updateChannelPartnerLink( + request?: protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | undefined + ), + {} | undefined + ] + >; + updateChannelPartnerLink( + request: protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateChannelPartnerLink( + request: protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateChannelPartnerLink( + request?: protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateChannelPartnerLink( + request, + options, + callback + ); + } + /** + * Gets information about how a Reseller modifies their bill before sending + * it to a Customer. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * NOT_FOUND: The {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} was not found. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} resource, otherwise returns + * an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the CustomerRepricingConfig. + * Format: + * accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomerRepricingConfig]{@link google.cloud.channel.v1.CustomerRepricingConfig}. + * 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/cloud_channel_service.get_customer_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_GetCustomerRepricingConfig_async + */ + getCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + getCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getCustomerRepricingConfig( + request, + options, + callback + ); + } + /** + * Creates a CustomerRepricingConfig. Call this method to set modifications + * for a specific customer's bill. You can only create configs if the + * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} is a + * future month. If needed, you can create a config for the current month, + * with some restrictions. + * + * When creating a config for a future month, make sure there are no existing + * configs for that + * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. + * + * The following restrictions are for creating configs in the current month. + * + * * This functionality is reserved for recovering from an erroneous config, + * and should not be used for regular business cases. + * * The new config will not modify exports used with other configs. + * Changes to the config may be immediate, but may take up to 24 hours. + * * There is a limit of ten configs for any + * {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement} + * or {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. + * * The contained {@link google.cloud.channel.v1.CustomerRepricingConfig.repricing_config|CustomerRepricingConfig.repricing_config} vaule must be + * different from the value used in the current config for a + * {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement}. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * INVALID_ARGUMENT: Missing or invalid required parameters in the + * request. Also displays if the updated config is for the current month or + * past months. + * * NOT_FOUND: The {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} specified does not exist or is + * not associated with the given account. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the updated {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} resource, otherwise + * returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the customer that will receive this repricing config. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {google.cloud.channel.v1.CustomerRepricingConfig} request.customerRepricingConfig + * Required. The CustomerRepricingConfig object to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomerRepricingConfig]{@link google.cloud.channel.v1.CustomerRepricingConfig}. + * 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/cloud_channel_service.create_customer_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_async + */ + createCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + createCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCustomerRepricingConfig( + request, + options, + callback + ); + } + /** + * Updates a CustomerRepricingConfig. Call this method to set modifications + * for a specific customer's bill. This method overwrites the existing + * CustomerRepricingConfig. + * + * You can only update configs if the + * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} is a + * future month. To make changes to configs for the current month, use + * {@link google.cloud.channel.v1.CloudChannelService.CreateCustomerRepricingConfig|CreateCustomerRepricingConfig}, taking note of its restrictions. You + * cannot update the {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. + * + * When updating a config in the future: + * + * * This config must already exist. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * INVALID_ARGUMENT: Missing or invalid required parameters in the + * request. Also displays if the updated config is for the current month or + * past months. + * * NOT_FOUND: The {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} specified does not exist or is + * not associated with the given account. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the updated {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} resource, otherwise + * returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.CustomerRepricingConfig} request.customerRepricingConfig + * Required. The CustomerRepricingConfig object to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CustomerRepricingConfig]{@link google.cloud.channel.v1.CustomerRepricingConfig}. + * 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/cloud_channel_service.update_customer_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_UpdateCustomerRepricingConfig_async + */ + updateCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, + callback: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'customer_repricing_config.name': + request.customerRepricingConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCustomerRepricingConfig( + request, + options, + callback + ); + } + /** + * Deletes the given {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} permanently. You can only + * delete configs if their {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} is set + * to a date after the current month. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The account making the request does not own + * this customer. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * FAILED_PRECONDITION: The {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} is active or in the + * past. + * * NOT_FOUND: No {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} found for the name in the + * request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the customer repricing config rule to delete. + * Format: + * accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_DeleteCustomerRepricingConfig_async + */ + deleteCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCustomerRepricingConfig( + request: protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCustomerRepricingConfig( + request?: protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteCustomerRepricingConfig( + request, + options, + callback + ); + } + /** + * Gets information about how a Distributor modifies their bill before sending + * it to a ChannelPartner. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * NOT_FOUND: The {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} was not found. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} resource, otherwise + * returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ChannelPartnerRepricingConfig + * Format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ChannelPartnerRepricingConfig]{@link google.cloud.channel.v1.ChannelPartnerRepricingConfig}. + * 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/cloud_channel_service.get_channel_partner_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerRepricingConfig_async + */ + getChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + getChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getChannelPartnerRepricingConfig( + request, + options, + callback + ); + } + /** + * Creates a ChannelPartnerRepricingConfig. Call this method to set + * modifications for a specific ChannelPartner's bill. You can only create + * configs if the {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} is a future + * month. If needed, you can create a config for the current month, with some + * restrictions. + * + * When creating a config for a future month, make sure there are no existing + * configs for that + * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. + * + * The following restrictions are for creating configs in the current month. + * + * * This functionality is reserved for recovering from an erroneous config, + * and should not be used for regular business cases. + * * The new config will not modify exports used with other configs. + * Changes to the config may be immediate, but may take up to 24 hours. + * * There is a limit of ten configs for any ChannelPartner or + * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. + * * The contained {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config|ChannelPartnerRepricingConfig.repricing_config} vaule + * must be different from the value used in the current config for a + * ChannelPartner. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * INVALID_ARGUMENT: Missing or invalid required parameters in the + * request. Also displays if the updated config is for the current month or + * past months. + * * NOT_FOUND: The {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} specified does not exist + * or is not associated with the given account. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the updated {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} resource, + * otherwise returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the ChannelPartner that will receive the repricing + * config. Parent uses the format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id} + * @param {google.cloud.channel.v1.ChannelPartnerRepricingConfig} request.channelPartnerRepricingConfig + * Required. The ChannelPartnerRepricingConfig object to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ChannelPartnerRepricingConfig]{@link google.cloud.channel.v1.ChannelPartnerRepricingConfig}. + * 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/cloud_channel_service.create_channel_partner_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_async + */ + createChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + createChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createChannelPartnerRepricingConfig( + request, + options, + callback + ); + } + /** + * Updates a ChannelPartnerRepricingConfig. Call this method to set + * modifications for a specific ChannelPartner's bill. This method overwrites + * the existing CustomerRepricingConfig. + * + * You can only update configs if the + * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} is a + * future month. To make changes to configs for the current month, use + * {@link google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerRepricingConfig|CreateChannelPartnerRepricingConfig}, taking note of its restrictions. + * You cannot update the {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. + * + * When updating a config in the future: + * + * * This config must already exist. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * INVALID_ARGUMENT: Missing or invalid required parameters in the + * request. Also displays if the updated config is for the current month or + * past months. + * * NOT_FOUND: The {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} specified does not exist + * or is not associated with the given account. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the updated {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} resource, + * otherwise returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.ChannelPartnerRepricingConfig} request.channelPartnerRepricingConfig + * Required. The ChannelPartnerRepricingConfig object to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ChannelPartnerRepricingConfig]{@link google.cloud.channel.v1.ChannelPartnerRepricingConfig}. + * 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/cloud_channel_service.update_channel_partner_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerRepricingConfig_async + */ + updateChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, + callback: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'channel_partner_repricing_config.name': + request.channelPartnerRepricingConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateChannelPartnerRepricingConfig( + request, + options, + callback + ); + } + /** + * Deletes the given {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} permanently. You can + * only delete configs if their {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} is + * set to a date after the current month. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The account making the request does not own + * this customer. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * FAILED_PRECONDITION: The {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} is active or + * in the past. + * * NOT_FOUND: No {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} found for the name in the + * request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the channel partner repricing config rule to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_DeleteChannelPartnerRepricingConfig_async + */ + deleteChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteChannelPartnerRepricingConfig( + request: protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteChannelPartnerRepricingConfig( + request?: protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteChannelPartnerRepricingConfig( + request, + options, + callback + ); + } + /** + * Returns the requested {@link google.cloud.channel.v1.Offer|Offer} resource. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The entitlement doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Entitlement or offer was not found. + * + * Return value: + * The {@link google.cloud.channel.v1.Offer|Offer} resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entitlement + * Required. The resource name of the entitlement to retrieve the Offer. + * Entitlement uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Offer]{@link google.cloud.channel.v1.Offer}. + * 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/cloud_channel_service.lookup_offer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_LookupOffer_async + */ + lookupOffer( + request?: protos.google.cloud.channel.v1.ILookupOfferRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | undefined, + {} | undefined + ] + >; + lookupOffer( + request: protos.google.cloud.channel.v1.ILookupOfferRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, + {} | null | undefined + > + ): void; + lookupOffer( + request: protos.google.cloud.channel.v1.ILookupOfferRequest, + callback: Callback< + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, + {} | null | undefined + > + ): void; + lookupOffer( + request?: protos.google.cloud.channel.v1.ILookupOfferRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + entitlement: request.entitlement ?? '', + }); + this.initialize(); + return this.innerApiCalls.lookupOffer(request, options, callback); + } + /** + * Registers a service account with subscriber privileges on the Cloud Pub/Sub + * topic for this Channel Services account. After you create a + * subscriber, you get the events through {@link google.cloud.channel.v1.SubscriberEvent|SubscriberEvent} + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request and the + * provided reseller account are different, or the impersonated user + * is not a super admin. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The topic name with the registered service email address. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. Resource name of the account. + * @param {string} request.serviceAccount + * Required. Service account that provides subscriber access to the registered topic. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RegisterSubscriberResponse]{@link google.cloud.channel.v1.RegisterSubscriberResponse}. + * 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/cloud_channel_service.register_subscriber.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async + */ + registerSubscriber( + request?: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + protos.google.cloud.channel.v1.IRegisterSubscriberRequest | undefined, + {} | undefined + ] + >; + registerSubscriber( + request: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + | protos.google.cloud.channel.v1.IRegisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + ): void; + registerSubscriber( + request: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, + callback: Callback< + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + | protos.google.cloud.channel.v1.IRegisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + ): void; + registerSubscriber( + request?: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + | protos.google.cloud.channel.v1.IRegisterSubscriberRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + | protos.google.cloud.channel.v1.IRegisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + protos.google.cloud.channel.v1.IRegisterSubscriberRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + account: request.account ?? '', + }); + this.initialize(); + return this.innerApiCalls.registerSubscriber(request, options, callback); + } + /** + * Unregisters a service account with subscriber privileges on the Cloud + * Pub/Sub topic created for this Channel Services account. If there are no + * service accounts left with subscriber privileges, this deletes the topic. + * You can call ListSubscribers to check for these accounts. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request and the + * provided reseller account are different, or the impersonated user + * is not a super admin. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The topic resource doesn't exist. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The topic name that unregistered the service email address. + * Returns a success response if the service email address wasn't registered + * with the topic. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. Resource name of the account. + * @param {string} request.serviceAccount + * Required. Service account to unregister from subscriber access to the topic. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [UnregisterSubscriberResponse]{@link google.cloud.channel.v1.UnregisterSubscriberResponse}. + * 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/cloud_channel_service.unregister_subscriber.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async + */ + unregisterSubscriber( + request?: protos.google.cloud.channel.v1.IUnregisterSubscriberRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + protos.google.cloud.channel.v1.IUnregisterSubscriberRequest | undefined, + {} | undefined + ] + >; + unregisterSubscriber( + request: protos.google.cloud.channel.v1.IUnregisterSubscriberRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + | protos.google.cloud.channel.v1.IUnregisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + ): void; + unregisterSubscriber( + request: protos.google.cloud.channel.v1.IUnregisterSubscriberRequest, + callback: Callback< + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + | protos.google.cloud.channel.v1.IUnregisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + ): void; + unregisterSubscriber( + request?: protos.google.cloud.channel.v1.IUnregisterSubscriberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + | protos.google.cloud.channel.v1.IUnregisterSubscriberRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + | protos.google.cloud.channel.v1.IUnregisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + protos.google.cloud.channel.v1.IUnregisterSubscriberRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + account: request.account ?? '', + }); + this.initialize(); + return this.innerApiCalls.unregisterSubscriber(request, options, callback); + } + + /** + * Creates a Cloud Identity for the given customer using the customer's + * information, or the information provided here. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The customer was not found. + * * ALREADY_EXISTS: The customer's primary email already exists. Retry + * after changing the customer's primary contact email. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata contains an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.customer + * Required. Resource name of the customer. + * Format: accounts/{account_id}/customers/{customer_id} + * @param {google.cloud.channel.v1.CloudIdentityInfo} request.cloudIdentityInfo + * CloudIdentity-specific customer information. + * @param {google.cloud.channel.v1.AdminUser} request.user + * Admin user information. + * @param {boolean} request.validateOnly + * Validate the request and preview the review, but do not post it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.provision_cloud_identity.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async + */ + provisionCloudIdentity( + request?: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + provisionCloudIdentity( + request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + provisionCloudIdentity( + request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + provisionCloudIdentity( + request?: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + this.initialize(); + return this.innerApiCalls.provisionCloudIdentity( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `provisionCloudIdentity()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.provision_cloud_identity.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async + */ + async checkProvisionCloudIdentityProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Customer, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.provisionCloudIdentity, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Customer, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Creates an entitlement for a customer. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: + * * Required request parameters are missing or invalid. + * * There is already a customer entitlement for a SKU from the same + * product family. + * * INVALID_VALUE: Make sure the OfferId is valid. If it is, contact + * Google Channel support for further troubleshooting. + * * NOT_FOUND: The customer or offer resource was not found. + * * ALREADY_EXISTS: + * * The SKU was already purchased for the customer. + * * The customer's primary email already exists. Retry + * after changing the customer's primary contact email. + * * CONDITION_NOT_MET or FAILED_PRECONDITION: + * * The domain required for purchasing a SKU has not been verified. + * * A pre-requisite SKU required to purchase an Add-On SKU is missing. + * For example, Google Workspace Business Starter is required to purchase + * Vault or Drive. + * * (Developer accounts only) Reseller and resold domain must meet the + * following naming requirements: + * * Domain names must start with goog-test. + * * Domain names must include the reseller domain. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller's customer account in which to create the + * entitlement. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {google.cloud.channel.v1.Entitlement} request.entitlement + * Required. The entitlement to create. + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.create_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async + */ + createEntitlement( + request?: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createEntitlement( + request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEntitlement( + request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEntitlement( + request?: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createEntitlement(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createEntitlement()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.create_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async + */ + async checkCreateEntitlementProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createEntitlement, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Change parameters of the entitlement. + * + * An entitlement update is a long-running operation and it updates the + * entitlement as a result of fulfillment. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * For example, the number of seats being changed is greater than the allowed + * number of max seats, or decreasing seats for a commitment based plan. + * * NOT_FOUND: Entitlement resource not found. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entitlement to update. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {number[]} request.parameters + * Required. Entitlement parameters to update. You can only change editable parameters. + * + * To view the available Parameters for a request, refer to the + * {@link google.cloud.channel.v1.Offer.parameter_definitions|Offer.parameter_definitions} from the desired offer. + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {string} [request.purchaseOrderId] + * Optional. Purchase order ID provided by the reseller. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.change_parameters.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async + */ + changeParameters( + request?: protos.google.cloud.channel.v1.IChangeParametersRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + changeParameters( + request: protos.google.cloud.channel.v1.IChangeParametersRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + changeParameters( + request: protos.google.cloud.channel.v1.IChangeParametersRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + changeParameters( + request?: protos.google.cloud.channel.v1.IChangeParametersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.changeParameters(request, options, callback); + } + /** + * Check the status of the long running operation returned by `changeParameters()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.change_parameters.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async + */ + async checkChangeParametersProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.changeParameters, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Updates the renewal settings for an existing customer entitlement. + * + * An entitlement update is a long-running operation and it updates the + * entitlement as a result of fulfillment. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Entitlement resource not found. + * * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a + * commitment plan. Can't enable or disable renewals for non-commitment plans. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entitlement to update. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {google.cloud.channel.v1.RenewalSettings} request.renewalSettings + * Required. New renewal settings. + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.change_renewal_settings.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async + */ + changeRenewalSettings( + request?: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + changeRenewalSettings( + request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + changeRenewalSettings( + request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + changeRenewalSettings( + request?: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.changeRenewalSettings(request, options, callback); + } + /** + * Check the status of the long running operation returned by `changeRenewalSettings()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.change_renewal_settings.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async + */ + async checkChangeRenewalSettingsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.changeRenewalSettings, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Updates the Offer for an existing customer entitlement. + * + * An entitlement update is a long-running operation and it updates the + * entitlement as a result of fulfillment. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Offer or Entitlement resource not found. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entitlement to update. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {string} request.offer + * Required. New Offer. + * Format: accounts/{account_id}/offers/{offer_id}. + * @param {number[]} [request.parameters] + * Optional. Parameters needed to purchase the Offer. To view the available Parameters + * refer to the {@link google.cloud.channel.v1.Offer.parameter_definitions|Offer.parameter_definitions} from the desired offer. + * @param {string} [request.purchaseOrderId] + * Optional. Purchase order id provided by the reseller. + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.change_offer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async + */ + changeOffer( + request?: protos.google.cloud.channel.v1.IChangeOfferRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + changeOffer( + request: protos.google.cloud.channel.v1.IChangeOfferRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + changeOffer( + request: protos.google.cloud.channel.v1.IChangeOfferRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + changeOffer( + request?: protos.google.cloud.channel.v1.IChangeOfferRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.changeOffer(request, options, callback); + } + /** + * Check the status of the long running operation returned by `changeOffer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.change_offer.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async + */ + async checkChangeOfferProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.changeOffer, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Starts paid service for a trial entitlement. + * + * Starts paid service for a trial entitlement immediately. This method is + * only applicable if a plan is set up for a trial entitlement but has some + * trial days remaining. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Entitlement resource not found. + * * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for + * entitlement on trial plans. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entitlement to start a paid service for. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.start_paid_service.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_StartPaidService_async + */ + startPaidService( + request?: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + startPaidService( + request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startPaidService( + request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startPaidService( + request?: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.startPaidService(request, options, callback); + } + /** + * Check the status of the long running operation returned by `startPaidService()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.start_paid_service.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_StartPaidService_async + */ + async checkStartPaidServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.startPaidService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Suspends a previously fulfilled entitlement. + * + * An entitlement suspension is a long-running operation. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Entitlement resource not found. + * * NOT_ACTIVE: Entitlement is not active. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entitlement to suspend. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.suspend_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async + */ + suspendEntitlement( + request?: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + suspendEntitlement( + request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + suspendEntitlement( + request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + suspendEntitlement( + request?: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.suspendEntitlement(request, options, callback); + } + /** + * Check the status of the long running operation returned by `suspendEntitlement()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.suspend_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async + */ + async checkSuspendEntitlementProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.suspendEntitlement, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Cancels a previously fulfilled entitlement. + * + * An entitlement cancellation is a long-running operation. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * FAILED_PRECONDITION: There are Google Cloud projects linked to the + * Google Cloud entitlement's Cloud Billing subaccount. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Entitlement resource not found. + * * DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace + * add-ons, or entitlements for Google Cloud's development platform. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The response will contain + * google.protobuf.Empty on success. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entitlement to cancel. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.cancel_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async + */ + cancelEntitlement( + request?: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + cancelEntitlement( + request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelEntitlement( + request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelEntitlement( + request?: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelEntitlement(request, options, callback); + } + /** + * Check the status of the long running operation returned by `cancelEntitlement()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.cancel_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async + */ + async checkCancelEntitlementProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.cancelEntitlement, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Activates a previously suspended entitlement. Entitlements suspended for + * pending ToS acceptance can't be activated using this method. + * + * An entitlement activation is a long-running operation and it updates + * the state of the customer entitlement. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: Entitlement resource not found. + * * SUSPENSION_NOT_RESELLER_INITIATED: Can only activate reseller-initiated + * suspensions and entitlements that have accepted the TOS. + * * NOT_SUSPENDED: Can only activate suspended entitlements not in an ACTIVE + * state. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the entitlement to activate. + * Name uses the format: + * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.activate_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async + */ + activateEntitlement( + request?: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + activateEntitlement( + request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + activateEntitlement( + request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + activateEntitlement( + request?: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.activateEntitlement(request, options, callback); + } + /** + * Check the status of the long running operation returned by `activateEntitlement()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.activate_entitlement.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async + */ + async checkActivateEntitlementProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.activateEntitlement, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.Entitlement, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Transfers customer entitlements to new reseller. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The customer or offer resource was not found. + * * ALREADY_EXISTS: The SKU was already transferred for the customer. + * * CONDITION_NOT_MET or FAILED_PRECONDITION: + * * The SKU requires domain verification to transfer, but the domain is + * not verified. + * * An Add-On SKU (example, Vault or Drive) is missing the + * pre-requisite SKU (example, G Suite Basic). + * * (Developer accounts only) Reseller and resold domain must meet the + * following naming requirements: + * * Domain names must start with goog-test. + * * Domain names must include the reseller domain. + * * Specify all transferring entitlements. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller's customer account that will receive + * transferred entitlements. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {number[]} request.entitlements + * Required. The new entitlements to create or transfer. + * @param {string} request.authToken + * The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.transfer_entitlements.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async + */ + transferEntitlements( + request?: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + transferEntitlements( + request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + transferEntitlements( + request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + callback: Callback< + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + transferEntitlements( + request?: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.transferEntitlements(request, options, callback); + } + /** + * Check the status of the long running operation returned by `transferEntitlements()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.transfer_entitlements.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async + */ + async checkTransferEntitlementsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.channel.v1.TransferEntitlementsResponse, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.transferEntitlements, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.channel.v1.TransferEntitlementsResponse, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * Transfers customer entitlements from their current reseller to Google. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The customer or offer resource was not found. + * * ALREADY_EXISTS: The SKU was already transferred for the customer. + * * CONDITION_NOT_MET or FAILED_PRECONDITION: + * * The SKU requires domain verification to transfer, but the domain is + * not verified. + * * An Add-On SKU (example, Vault or Drive) is missing the + * pre-requisite SKU (example, G Suite Basic). + * * (Developer accounts only) Reseller and resold domain must meet the + * following naming requirements: + * * Domain names must start with goog-test. + * * Domain names must include the reseller domain. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * The ID of a long-running operation. + * + * To get the results of the operation, call the GetOperation method of + * CloudChannelOperationsService. The response will contain + * google.protobuf.Empty on success. The Operation metadata will contain an + * instance of {@link google.cloud.channel.v1.OperationMetadata|OperationMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller's customer account where the entitlements + * transfer from. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {number[]} request.entitlements + * Required. The entitlements to transfer to Google. + * @param {string} [request.requestId] + * Optional. You can specify an optional unique request ID, and if you need to retry + * your request, the server will know to ignore the request if it's complete. + * + * For example, you make an initial request and the request times out. If you + * make the request again with the same request ID, the server can check if + * it received the original operation with the same request ID. If it did, it + * will ignore the second request. + * + * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) + * with the exception that zero UUID is not supported + * (`00000000-0000-0000-0000-000000000000`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_channel_service.transfer_entitlements_to_google.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async + */ + transferEntitlementsToGoogle( + request?: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + transferEntitlementsToGoogle( + request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + transferEntitlementsToGoogle( + request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + transferEntitlementsToGoogle( + request?: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.transferEntitlementsToGoogle( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `transferEntitlementsToGoogle()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async + */ + async checkTransferEntitlementsToGoogleProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.channel.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.transferEntitlementsToGoogle, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.channel.v1.OperationMetadata + >; + } + /** + * List {@link google.cloud.channel.v1.Customer|Customer}s. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * Return value: + * List of {@link google.cloud.channel.v1.Customer|Customer}s, or an empty list if there are no customers. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account to list customers from. + * Parent uses the format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. The maximum number of customers to return. The service may return fewer + * than this value. If unspecified, returns at most 10 customers. The + * maximum value is 50. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results other than the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListCustomersResponse.next_page_token|ListCustomersResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListCustomers|CloudChannelService.ListCustomers} call. + * @param {string} [request.filter] + * Optional. Filters applied to the [CloudChannelService.ListCustomers] results. See + * https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers + * for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Customer]{@link google.cloud.channel.v1.Customer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomersAsync()` + * 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. + */ + listCustomers( + request?: protos.google.cloud.channel.v1.IListCustomersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer[], + protos.google.cloud.channel.v1.IListCustomersRequest | null, + protos.google.cloud.channel.v1.IListCustomersResponse + ] + >; + listCustomers( + request: protos.google.cloud.channel.v1.IListCustomersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListCustomersRequest, + protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, + protos.google.cloud.channel.v1.ICustomer + > + ): void; + listCustomers( + request: protos.google.cloud.channel.v1.IListCustomersRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListCustomersRequest, + protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, + protos.google.cloud.channel.v1.ICustomer + > + ): void; + listCustomers( + request?: protos.google.cloud.channel.v1.IListCustomersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListCustomersRequest, + | protos.google.cloud.channel.v1.IListCustomersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomer + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListCustomersRequest, + protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, + protos.google.cloud.channel.v1.ICustomer + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomer[], + protos.google.cloud.channel.v1.IListCustomersRequest | null, + protos.google.cloud.channel.v1.IListCustomersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listCustomers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account to list customers from. + * Parent uses the format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. The maximum number of customers to return. The service may return fewer + * than this value. If unspecified, returns at most 10 customers. The + * maximum value is 50. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results other than the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListCustomersResponse.next_page_token|ListCustomersResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListCustomers|CloudChannelService.ListCustomers} call. + * @param {string} [request.filter] + * Optional. Filters applied to the [CloudChannelService.ListCustomers] results. See + * https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers + * for more information. + * @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 [Customer]{@link google.cloud.channel.v1.Customer} 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 `listCustomersAsync()` + * 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. + */ + listCustomersStream( + request?: protos.google.cloud.channel.v1.IListCustomersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomers.createStream( + this.innerApiCalls.listCustomers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCustomers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account to list customers from. + * Parent uses the format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. The maximum number of customers to return. The service may return fewer + * than this value. If unspecified, returns at most 10 customers. The + * maximum value is 50. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results other than the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListCustomersResponse.next_page_token|ListCustomersResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListCustomers|CloudChannelService.ListCustomers} call. + * @param {string} [request.filter] + * Optional. Filters applied to the [CloudChannelService.ListCustomers] results. See + * https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers + * for more information. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Customer]{@link google.cloud.channel.v1.Customer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_customers.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListCustomers_async + */ + listCustomersAsync( + request?: protos.google.cloud.channel.v1.IListCustomersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomers.asyncIterate( + this.innerApiCalls['listCustomers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists {@link google.cloud.channel.v1.Entitlement|Entitlement}s belonging to a customer. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * Return value: + * A list of the customer's {@link google.cloud.channel.v1.Entitlement|Entitlement}s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller's customer account to list + * entitlements for. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, return at most 50 entitlements. + * The maximum value is 100; the server will coerce values above 100. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListEntitlementsResponse.next_page_token|ListEntitlementsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListEntitlements|CloudChannelService.ListEntitlements} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Entitlement]{@link google.cloud.channel.v1.Entitlement}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEntitlementsAsync()` + * 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. + */ + listEntitlements( + request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IEntitlement[], + protos.google.cloud.channel.v1.IListEntitlementsRequest | null, + protos.google.cloud.channel.v1.IListEntitlementsResponse + ] + >; + listEntitlements( + request: protos.google.cloud.channel.v1.IListEntitlementsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListEntitlementsRequest, + | protos.google.cloud.channel.v1.IListEntitlementsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IEntitlement + > + ): void; + listEntitlements( + request: protos.google.cloud.channel.v1.IListEntitlementsRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListEntitlementsRequest, + | protos.google.cloud.channel.v1.IListEntitlementsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IEntitlement + > + ): void; + listEntitlements( + request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListEntitlementsRequest, + | protos.google.cloud.channel.v1.IListEntitlementsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IEntitlement + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListEntitlementsRequest, + | protos.google.cloud.channel.v1.IListEntitlementsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IEntitlement + > + ): Promise< + [ + protos.google.cloud.channel.v1.IEntitlement[], + protos.google.cloud.channel.v1.IListEntitlementsRequest | null, + protos.google.cloud.channel.v1.IListEntitlementsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listEntitlements(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller's customer account to list + * entitlements for. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, return at most 50 entitlements. + * The maximum value is 100; the server will coerce values above 100. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListEntitlementsResponse.next_page_token|ListEntitlementsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListEntitlements|CloudChannelService.ListEntitlements} call. + * @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 [Entitlement]{@link google.cloud.channel.v1.Entitlement} 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 `listEntitlementsAsync()` + * 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. + */ + listEntitlementsStream( + request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEntitlements']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntitlements.createStream( + this.innerApiCalls.listEntitlements as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEntitlements`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller's customer account to list + * entitlements for. + * Parent uses the format: accounts/{account_id}/customers/{customer_id} + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, return at most 50 entitlements. + * The maximum value is 100; the server will coerce values above 100. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListEntitlementsResponse.next_page_token|ListEntitlementsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListEntitlements|CloudChannelService.ListEntitlements} call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Entitlement]{@link google.cloud.channel.v1.Entitlement}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_entitlements.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async + */ + listEntitlementsAsync( + request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEntitlements']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEntitlements.asyncIterate( + this.innerApiCalls['listEntitlements'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List {@link google.cloud.channel.v1.TransferableSku|TransferableSku}s of a customer based on the Cloud Identity ID or + * Customer Name in the request. + * + * Use this method to list the entitlements information of an + * unowned customer. You should provide the customer's + * Cloud Identity ID or Customer Name. + * + * Possible error codes: + * + * * PERMISSION_DENIED: + * * The customer doesn't belong to the reseller and has no auth token. + * * The supplied auth token is invalid. + * * The reseller account making the request is different + * from the reseller account in the query. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * Return value: + * A list of the customer's {@link google.cloud.channel.v1.TransferableSku|TransferableSku}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.cloudIdentityId + * Customer's Cloud Identity ID + * @param {string} request.customerName + * A reseller is required to create a customer and use the resource name of + * the created customer here. + * Customer_name uses the format: + * accounts/{account_id}/customers/{customer_id} + * @param {string} request.parent + * Required. The reseller account's resource name. + * Parent uses the format: accounts/{account_id} + * @param {number} request.pageSize + * The requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * Optional. + * @param {string} request.pageToken + * A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token|ListTransferableSkusResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListTransferableSkus|CloudChannelService.ListTransferableSkus} call. + * Optional. + * @param {string} [request.authToken] + * Optional. The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + * @param {string} request.languageCode + * The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * Optional. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [TransferableSku]{@link google.cloud.channel.v1.TransferableSku}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTransferableSkusAsync()` + * 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. + */ + listTransferableSkus( + request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ITransferableSku[], + protos.google.cloud.channel.v1.IListTransferableSkusRequest | null, + protos.google.cloud.channel.v1.IListTransferableSkusResponse + ] + >; + listTransferableSkus( + request: protos.google.cloud.channel.v1.IListTransferableSkusRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableSkusRequest, + | protos.google.cloud.channel.v1.IListTransferableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableSku + > + ): void; + listTransferableSkus( + request: protos.google.cloud.channel.v1.IListTransferableSkusRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableSkusRequest, + | protos.google.cloud.channel.v1.IListTransferableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableSku + > + ): void; + listTransferableSkus( + request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableSkusRequest, + | protos.google.cloud.channel.v1.IListTransferableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableSku + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableSkusRequest, + | protos.google.cloud.channel.v1.IListTransferableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableSku + > + ): Promise< + [ + protos.google.cloud.channel.v1.ITransferableSku[], + protos.google.cloud.channel.v1.IListTransferableSkusRequest | null, + protos.google.cloud.channel.v1.IListTransferableSkusResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTransferableSkus(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.cloudIdentityId + * Customer's Cloud Identity ID + * @param {string} request.customerName + * A reseller is required to create a customer and use the resource name of + * the created customer here. + * Customer_name uses the format: + * accounts/{account_id}/customers/{customer_id} + * @param {string} request.parent + * Required. The reseller account's resource name. + * Parent uses the format: accounts/{account_id} + * @param {number} request.pageSize + * The requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * Optional. + * @param {string} request.pageToken + * A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token|ListTransferableSkusResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListTransferableSkus|CloudChannelService.ListTransferableSkus} call. + * Optional. + * @param {string} [request.authToken] + * Optional. The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + * @param {string} request.languageCode + * The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * Optional. + * @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 [TransferableSku]{@link google.cloud.channel.v1.TransferableSku} 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 `listTransferableSkusAsync()` + * 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. + */ + listTransferableSkusStream( + request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTransferableSkus']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferableSkus.createStream( + this.innerApiCalls.listTransferableSkus as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferableSkus`, 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.cloudIdentityId + * Customer's Cloud Identity ID + * @param {string} request.customerName + * A reseller is required to create a customer and use the resource name of + * the created customer here. + * Customer_name uses the format: + * accounts/{account_id}/customers/{customer_id} + * @param {string} request.parent + * Required. The reseller account's resource name. + * Parent uses the format: accounts/{account_id} + * @param {number} request.pageSize + * The requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * Optional. + * @param {string} request.pageToken + * A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token|ListTransferableSkusResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListTransferableSkus|CloudChannelService.ListTransferableSkus} call. + * Optional. + * @param {string} [request.authToken] + * Optional. The super admin of the resold customer generates this token to + * authorize a reseller to access their Cloud Identity and purchase + * entitlements on their behalf. You can omit this token after authorization. + * See https://support.google.com/a/answer/7643790 for more details. + * @param {string} request.languageCode + * The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * Optional. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TransferableSku]{@link google.cloud.channel.v1.TransferableSku}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_transferable_skus.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async + */ + listTransferableSkusAsync( + request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTransferableSkus']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferableSkus.asyncIterate( + this.innerApiCalls['listTransferableSkus'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List {@link google.cloud.channel.v1.TransferableOffer|TransferableOffer}s of a customer based on Cloud Identity ID or + * Customer Name in the request. + * + * Use this method when a reseller gets the entitlement information of an + * unowned customer. The reseller should provide the customer's + * Cloud Identity ID or Customer Name. + * + * Possible error codes: + * + * * PERMISSION_DENIED: + * * The customer doesn't belong to the reseller and has no auth token. + * * The customer provided incorrect reseller information when generating + * auth token. + * * The reseller account making the request is different + * from the reseller account in the query. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * Return value: + * List of {@link google.cloud.channel.v1.TransferableOffer|TransferableOffer} for the given customer and SKU. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.cloudIdentityId + * Customer's Cloud Identity ID + * @param {string} request.customerName + * A reseller should create a customer and use the resource name of + * that customer here. + * @param {string} request.parent + * Required. The resource name of the reseller's account. + * @param {number} request.pageSize + * Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} request.pageToken + * A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token|ListTransferableOffersResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListTransferableOffers|CloudChannelService.ListTransferableOffers} call. + * @param {string} request.sku + * Required. The SKU to look up Offers for. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [TransferableOffer]{@link google.cloud.channel.v1.TransferableOffer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTransferableOffersAsync()` + * 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. + */ + listTransferableOffers( + request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ITransferableOffer[], + protos.google.cloud.channel.v1.IListTransferableOffersRequest | null, + protos.google.cloud.channel.v1.IListTransferableOffersResponse + ] + >; + listTransferableOffers( + request: protos.google.cloud.channel.v1.IListTransferableOffersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableOffersRequest, + | protos.google.cloud.channel.v1.IListTransferableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableOffer + > + ): void; + listTransferableOffers( + request: protos.google.cloud.channel.v1.IListTransferableOffersRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableOffersRequest, + | protos.google.cloud.channel.v1.IListTransferableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableOffer + > + ): void; + listTransferableOffers( + request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableOffersRequest, + | protos.google.cloud.channel.v1.IListTransferableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableOffer + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableOffersRequest, + | protos.google.cloud.channel.v1.IListTransferableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableOffer + > + ): Promise< + [ + protos.google.cloud.channel.v1.ITransferableOffer[], + protos.google.cloud.channel.v1.IListTransferableOffersRequest | null, + protos.google.cloud.channel.v1.IListTransferableOffersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTransferableOffers( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.cloudIdentityId + * Customer's Cloud Identity ID + * @param {string} request.customerName + * A reseller should create a customer and use the resource name of + * that customer here. + * @param {string} request.parent + * Required. The resource name of the reseller's account. + * @param {number} request.pageSize + * Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} request.pageToken + * A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token|ListTransferableOffersResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListTransferableOffers|CloudChannelService.ListTransferableOffers} call. + * @param {string} request.sku + * Required. The SKU to look up Offers for. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @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 [TransferableOffer]{@link google.cloud.channel.v1.TransferableOffer} 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 `listTransferableOffersAsync()` + * 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. + */ + listTransferableOffersStream( + request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTransferableOffers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferableOffers.createStream( + this.innerApiCalls.listTransferableOffers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTransferableOffers`, 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.cloudIdentityId + * Customer's Cloud Identity ID + * @param {string} request.customerName + * A reseller should create a customer and use the resource name of + * that customer here. + * @param {string} request.parent + * Required. The resource name of the reseller's account. + * @param {number} request.pageSize + * Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} request.pageToken + * A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token|ListTransferableOffersResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListTransferableOffers|CloudChannelService.ListTransferableOffers} call. + * @param {string} request.sku + * Required. The SKU to look up Offers for. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [TransferableOffer]{@link google.cloud.channel.v1.TransferableOffer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_transferable_offers.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async + */ + listTransferableOffersAsync( + request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTransferableOffers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTransferableOffers.asyncIterate( + this.innerApiCalls['listTransferableOffers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}s belonging to a distributor. + * You must be a distributor to call this method. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request is different + * from the reseller account in the API request. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * Return value: + * The list of the distributor account's {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account for listing channel partner + * links. + * Parent uses the format: accounts/{account_id} + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, server will pick a default size (25). + * The maximum value is 200; the server will coerce values above 200. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token|ListChannelPartnerLinksResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks|CloudChannelService.ListChannelPartnerLinks} call. + * @param {google.cloud.channel.v1.ChannelPartnerLinkView} [request.view] + * Optional. The level of granularity the ChannelPartnerLink will display. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ChannelPartnerLink]{@link google.cloud.channel.v1.ChannelPartnerLink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listChannelPartnerLinksAsync()` + * 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. + */ + listChannelPartnerLinks( + request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink[], + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest | null, + protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + ] + >; + listChannelPartnerLinks( + request: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerLink + > + ): void; + listChannelPartnerLinks( + request: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerLink + > + ): void; + listChannelPartnerLinks( + request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerLink + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerLink + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerLink[], + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest | null, + protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listChannelPartnerLinks( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account for listing channel partner + * links. + * Parent uses the format: accounts/{account_id} + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, server will pick a default size (25). + * The maximum value is 200; the server will coerce values above 200. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token|ListChannelPartnerLinksResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks|CloudChannelService.ListChannelPartnerLinks} call. + * @param {google.cloud.channel.v1.ChannelPartnerLinkView} [request.view] + * Optional. The level of granularity the ChannelPartnerLink will display. + * @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 [ChannelPartnerLink]{@link google.cloud.channel.v1.ChannelPartnerLink} 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 `listChannelPartnerLinksAsync()` + * 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. + */ + listChannelPartnerLinksStream( + request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChannelPartnerLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannelPartnerLinks.createStream( + this.innerApiCalls.listChannelPartnerLinks as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listChannelPartnerLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account for listing channel partner + * links. + * Parent uses the format: accounts/{account_id} + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, server will pick a default size (25). + * The maximum value is 200; the server will coerce values above 200. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Obtained using + * {@link google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token|ListChannelPartnerLinksResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks|CloudChannelService.ListChannelPartnerLinks} call. + * @param {google.cloud.channel.v1.ChannelPartnerLinkView} [request.view] + * Optional. The level of granularity the ChannelPartnerLink will display. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ChannelPartnerLink]{@link google.cloud.channel.v1.ChannelPartnerLink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_channel_partner_links.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async + */ + listChannelPartnerLinksAsync( + request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChannelPartnerLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannelPartnerLinks.asyncIterate( + this.innerApiCalls['listChannelPartnerLinks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists information about how a Reseller modifies their bill before sending + * it to a Customer. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * NOT_FOUND: The {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} specified does not exist or is + * not associated with the given account. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the {@link google.cloud.channel.v1.CustomerRepricingConfig|CustomerRepricingConfig} resources. The + * data for each resource is displayed in the ascending order of: + * * customer ID + * * {@link google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement} + * * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} + * * {@link google.cloud.channel.v1.CustomerRepricingConfig.update_time|CustomerRepricingConfig.update_time} + * + * If unsuccessful, returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the customer. + * Parent uses the format: accounts/{account_id}/customers/{customer_id}. + * Supports accounts/{account_id}/customers/- to retrieve configs for all + * customers. + * @param {number} [request.pageSize] + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token|ListCustomerRepricingConfigsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs|CloudChannelService.ListCustomerRepricingConfigs} call. + * @param {string} [request.filter] + * Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs] + * results (customer only). You can use this filter when you support + * a BatchGet-like query. + * To use the filter, you must set `parent=accounts/{account_id}/customers/-`. + * + * Example: customer = accounts/account_id/customers/c1 OR + * customer = accounts/account_id/customers/c2. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [CustomerRepricingConfig]{@link google.cloud.channel.v1.CustomerRepricingConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCustomerRepricingConfigsAsync()` + * 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. + */ + listCustomerRepricingConfigs( + request?: protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig[], + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest | null, + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + ] + >; + listCustomerRepricingConfigs( + request: protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomerRepricingConfig + > + ): void; + listCustomerRepricingConfigs( + request: protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomerRepricingConfig + > + ): void; + listCustomerRepricingConfigs( + request?: protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomerRepricingConfig + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomerRepricingConfig + > + ): Promise< + [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig[], + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest | null, + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listCustomerRepricingConfigs( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the customer. + * Parent uses the format: accounts/{account_id}/customers/{customer_id}. + * Supports accounts/{account_id}/customers/- to retrieve configs for all + * customers. + * @param {number} [request.pageSize] + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token|ListCustomerRepricingConfigsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs|CloudChannelService.ListCustomerRepricingConfigs} call. + * @param {string} [request.filter] + * Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs] + * results (customer only). You can use this filter when you support + * a BatchGet-like query. + * To use the filter, you must set `parent=accounts/{account_id}/customers/-`. + * + * Example: customer = accounts/account_id/customers/c1 OR + * customer = accounts/account_id/customers/c2. + * @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 [CustomerRepricingConfig]{@link google.cloud.channel.v1.CustomerRepricingConfig} 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 `listCustomerRepricingConfigsAsync()` + * 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. + */ + listCustomerRepricingConfigsStream( + request?: protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomerRepricingConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomerRepricingConfigs.createStream( + this.innerApiCalls.listCustomerRepricingConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCustomerRepricingConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the customer. + * Parent uses the format: accounts/{account_id}/customers/{customer_id}. + * Supports accounts/{account_id}/customers/- to retrieve configs for all + * customers. + * @param {number} [request.pageSize] + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token|ListCustomerRepricingConfigsResponse.next_page_token} of the previous + * {@link google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs|CloudChannelService.ListCustomerRepricingConfigs} call. + * @param {string} [request.filter] + * Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs] + * results (customer only). You can use this filter when you support + * a BatchGet-like query. + * To use the filter, you must set `parent=accounts/{account_id}/customers/-`. + * + * Example: customer = accounts/account_id/customers/c1 OR + * customer = accounts/account_id/customers/c2. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CustomerRepricingConfig]{@link google.cloud.channel.v1.CustomerRepricingConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListCustomerRepricingConfigs_async + */ + listCustomerRepricingConfigsAsync( + request?: protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCustomerRepricingConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCustomerRepricingConfigs.asyncIterate( + this.innerApiCalls['listCustomerRepricingConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists information about how a Reseller modifies their bill before sending + * it to a ChannelPartner. + * + * Possible Error Codes: + * + * * PERMISSION_DENIED: If the account making the request and the account + * being queried are different. + * * NOT_FOUND: The {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} specified does not exist + * or is not associated with the given account. + * * INTERNAL: Any non-user error related to technical issues in the + * backend. In this case, contact Cloud Channel support. + * + * Return Value: + * If successful, the {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig|ChannelPartnerRepricingConfig} resources. + * The data for each resource is displayed in the ascending order of: + * * channel partner ID + * * {@link google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month} + * * {@link google.cloud.channel.v1.ChannelPartnerRepricingConfig.update_time|ChannelPartnerRepricingConfig.update_time} + * + * If unsuccessful, returns an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the account's {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}. + * Parent uses the format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. + * Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs + * for all channel partners. + * @param {number} [request.pageSize] + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.next_page_token|ListChannelPartnerRepricingConfigsResponse.next_page_token} of the + * previous {@link google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs|CloudChannelService.ListChannelPartnerRepricingConfigs} call. + * @param {string} [request.filter] + * Optional. A filter for [CloudChannelService.ListChannelPartnerRepricingConfigs] + * results (channel_partner_link only). You can use this filter when you + * support a BatchGet-like query. + * To use the filter, you must set + * `parent=accounts/{account_id}/channelPartnerLinks/-`. + * + * Example: `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c1` OR `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c2`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ChannelPartnerRepricingConfig]{@link google.cloud.channel.v1.ChannelPartnerRepricingConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listChannelPartnerRepricingConfigsAsync()` + * 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. + */ + listChannelPartnerRepricingConfigs( + request?: protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig[], + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest | null, + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + ] + >; + listChannelPartnerRepricingConfigs( + request: protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig + > + ): void; + listChannelPartnerRepricingConfigs( + request: protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig + > + ): void; + listChannelPartnerRepricingConfigs( + request?: protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig + > + ): Promise< + [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig[], + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest | null, + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listChannelPartnerRepricingConfigs( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the account's {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}. + * Parent uses the format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. + * Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs + * for all channel partners. + * @param {number} [request.pageSize] + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.next_page_token|ListChannelPartnerRepricingConfigsResponse.next_page_token} of the + * previous {@link google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs|CloudChannelService.ListChannelPartnerRepricingConfigs} call. + * @param {string} [request.filter] + * Optional. A filter for [CloudChannelService.ListChannelPartnerRepricingConfigs] + * results (channel_partner_link only). You can use this filter when you + * support a BatchGet-like query. + * To use the filter, you must set + * `parent=accounts/{account_id}/channelPartnerLinks/-`. + * + * Example: `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c1` OR `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c2`. + * @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 [ChannelPartnerRepricingConfig]{@link google.cloud.channel.v1.ChannelPartnerRepricingConfig} 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 `listChannelPartnerRepricingConfigsAsync()` + * 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. + */ + listChannelPartnerRepricingConfigsStream( + request?: protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = + this._defaults['listChannelPartnerRepricingConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannelPartnerRepricingConfigs.createStream( + this.innerApiCalls.listChannelPartnerRepricingConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listChannelPartnerRepricingConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the account's {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}. + * Parent uses the format: + * accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. + * Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs + * for all channel partners. + * @param {number} [request.pageSize] + * Optional. The maximum number of repricing configs to return. The service may return + * fewer than this value. If unspecified, returns a maximum of 50 rules. The + * maximum value is 100; values above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results beyond the first page. + * Obtained through + * {@link google.cloud.channel.v1.ListChannelPartnerRepricingConfigsResponse.next_page_token|ListChannelPartnerRepricingConfigsResponse.next_page_token} of the + * previous {@link google.cloud.channel.v1.CloudChannelService.ListChannelPartnerRepricingConfigs|CloudChannelService.ListChannelPartnerRepricingConfigs} call. + * @param {string} [request.filter] + * Optional. A filter for [CloudChannelService.ListChannelPartnerRepricingConfigs] + * results (channel_partner_link only). You can use this filter when you + * support a BatchGet-like query. + * To use the filter, you must set + * `parent=accounts/{account_id}/channelPartnerLinks/-`. + * + * Example: `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c1` OR `channel_partner_link = + * accounts/account_id/channelPartnerLinks/c2`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ChannelPartnerRepricingConfig]{@link google.cloud.channel.v1.ChannelPartnerRepricingConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerRepricingConfigs_async + */ + listChannelPartnerRepricingConfigsAsync( + request?: protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = + this._defaults['listChannelPartnerRepricingConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listChannelPartnerRepricingConfigs.asyncIterate( + this.innerApiCalls['listChannelPartnerRepricingConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Products the reseller is authorized to sell. + * + * Possible error codes: + * + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. The resource name of the reseller account. + * Format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Products. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Product]{@link google.cloud.channel.v1.Product}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listProductsAsync()` + * 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. + */ + listProducts( + request?: protos.google.cloud.channel.v1.IListProductsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IProduct[], + protos.google.cloud.channel.v1.IListProductsRequest | null, + protos.google.cloud.channel.v1.IListProductsResponse + ] + >; + listProducts( + request: protos.google.cloud.channel.v1.IListProductsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListProductsRequest, + protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, + protos.google.cloud.channel.v1.IProduct + > + ): void; + listProducts( + request: protos.google.cloud.channel.v1.IListProductsRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListProductsRequest, + protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, + protos.google.cloud.channel.v1.IProduct + > + ): void; + listProducts( + request?: protos.google.cloud.channel.v1.IListProductsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListProductsRequest, + | protos.google.cloud.channel.v1.IListProductsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IProduct + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListProductsRequest, + protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, + protos.google.cloud.channel.v1.IProduct + > + ): Promise< + [ + protos.google.cloud.channel.v1.IProduct[], + protos.google.cloud.channel.v1.IListProductsRequest | null, + protos.google.cloud.channel.v1.IListProductsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.listProducts(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. The resource name of the reseller account. + * Format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Products. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @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 [Product]{@link google.cloud.channel.v1.Product} 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 `listProductsAsync()` + * 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. + */ + listProductsStream( + request?: protos.google.cloud.channel.v1.IListProductsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listProducts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProducts.createStream( + this.innerApiCalls.listProducts as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listProducts`, 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.account + * Required. The resource name of the reseller account. + * Format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Products. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Product]{@link google.cloud.channel.v1.Product}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_products.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListProducts_async + */ + listProductsAsync( + request?: protos.google.cloud.channel.v1.IListProductsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listProducts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProducts.asyncIterate( + this.innerApiCalls['listProducts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the SKUs for a product the reseller is authorized to sell. + * + * Possible error codes: + * + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Product to list SKUs for. + * Parent uses the format: products/{product_id}. + * Supports products/- to retrieve SKUs for all products. + * @param {string} request.account + * Required. Resource name of the reseller. + * Format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Optional. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Sku]{@link google.cloud.channel.v1.Sku}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSkusAsync()` + * 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. + */ + listSkus( + request?: protos.google.cloud.channel.v1.IListSkusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.ISku[], + protos.google.cloud.channel.v1.IListSkusRequest | null, + protos.google.cloud.channel.v1.IListSkusResponse + ] + >; + listSkus( + request: protos.google.cloud.channel.v1.IListSkusRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListSkusRequest, + protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, + protos.google.cloud.channel.v1.ISku + > + ): void; + listSkus( + request: protos.google.cloud.channel.v1.IListSkusRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListSkusRequest, + protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, + protos.google.cloud.channel.v1.ISku + > + ): void; + listSkus( + request?: protos.google.cloud.channel.v1.IListSkusRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListSkusRequest, + protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, + protos.google.cloud.channel.v1.ISku + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListSkusRequest, + protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, + protos.google.cloud.channel.v1.ISku + > + ): Promise< + [ + protos.google.cloud.channel.v1.ISku[], + protos.google.cloud.channel.v1.IListSkusRequest | null, + protos.google.cloud.channel.v1.IListSkusResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSkus(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Product to list SKUs for. + * Parent uses the format: products/{product_id}. + * Supports products/- to retrieve SKUs for all products. + * @param {string} request.account + * Required. Resource name of the reseller. + * Format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Optional. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @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 [Sku]{@link google.cloud.channel.v1.Sku} 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 `listSkusAsync()` + * 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. + */ + listSkusStream( + request?: protos.google.cloud.channel.v1.IListSkusRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSkus']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSkus.createStream( + this.innerApiCalls.listSkus as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSkus`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Product to list SKUs for. + * Parent uses the format: products/{product_id}. + * Supports products/- to retrieve SKUs for all products. + * @param {string} request.account + * Required. Resource name of the reseller. + * Format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * Optional. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Sku]{@link google.cloud.channel.v1.Sku}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_skus.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListSkus_async + */ + listSkusAsync( + request?: protos.google.cloud.channel.v1.IListSkusRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSkus']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSkus.asyncIterate( + this.innerApiCalls['listSkus'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Offers the reseller can sell. + * + * Possible error codes: + * + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account from which to list Offers. + * Parent uses the format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 500 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.filter] + * Optional. The expression to filter results by name (name of + * the Offer), sku.name (name of the SKU), or sku.product.name (name of the + * Product). + * Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1 + * Example 2: name=accounts/a1/offers/o1 + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Offer]{@link google.cloud.channel.v1.Offer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listOffersAsync()` + * 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. + */ + listOffers( + request?: protos.google.cloud.channel.v1.IListOffersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IOffer[], + protos.google.cloud.channel.v1.IListOffersRequest | null, + protos.google.cloud.channel.v1.IListOffersResponse + ] + >; + listOffers( + request: protos.google.cloud.channel.v1.IListOffersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListOffersRequest, + protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, + protos.google.cloud.channel.v1.IOffer + > + ): void; + listOffers( + request: protos.google.cloud.channel.v1.IListOffersRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListOffersRequest, + protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, + protos.google.cloud.channel.v1.IOffer + > + ): void; + listOffers( + request?: protos.google.cloud.channel.v1.IListOffersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListOffersRequest, + protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, + protos.google.cloud.channel.v1.IOffer + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListOffersRequest, + protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, + protos.google.cloud.channel.v1.IOffer + > + ): Promise< + [ + protos.google.cloud.channel.v1.IOffer[], + protos.google.cloud.channel.v1.IListOffersRequest | null, + protos.google.cloud.channel.v1.IListOffersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOffers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account from which to list Offers. + * Parent uses the format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 500 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.filter] + * Optional. The expression to filter results by name (name of + * the Offer), sku.name (name of the SKU), or sku.product.name (name of the + * Product). + * Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1 + * Example 2: name=accounts/a1/offers/o1 + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @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 [Offer]{@link google.cloud.channel.v1.Offer} 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 `listOffersAsync()` + * 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. + */ + listOffersStream( + request?: protos.google.cloud.channel.v1.IListOffersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listOffers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOffers.createStream( + this.innerApiCalls.listOffers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listOffers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the reseller account from which to list Offers. + * Parent uses the format: accounts/{account_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 500 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.filter] + * Optional. The expression to filter results by name (name of + * the Offer), sku.name (name of the SKU), or sku.product.name (name of the + * Product). + * Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1 + * Example 2: name=accounts/a1/offers/o1 + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Offer]{@link google.cloud.channel.v1.Offer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_offers.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListOffers_async + */ + listOffersAsync( + request?: protos.google.cloud.channel.v1.IListOffersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listOffers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOffers.asyncIterate( + this.innerApiCalls['listOffers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the following: + * + * * SKUs that you can purchase for a customer + * * SKUs that you can upgrade or downgrade for an entitlement. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} request.createEntitlementPurchase + * List SKUs for CreateEntitlement purchase. + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} request.changeOfferPurchase + * List SKUs for ChangeOffer purchase with a new SKU. + * @param {string} request.customer + * Required. The resource name of the customer to list SKUs for. + * Format: accounts/{account_id}/customers/{customer_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PurchasableSku]{@link google.cloud.channel.v1.PurchasableSku}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPurchasableSkusAsync()` + * 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. + */ + listPurchasableSkus( + request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IPurchasableSku[], + protos.google.cloud.channel.v1.IListPurchasableSkusRequest | null, + protos.google.cloud.channel.v1.IListPurchasableSkusResponse + ] + >; + listPurchasableSkus( + request: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + | protos.google.cloud.channel.v1.IListPurchasableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableSku + > + ): void; + listPurchasableSkus( + request: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + | protos.google.cloud.channel.v1.IListPurchasableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableSku + > + ): void; + listPurchasableSkus( + request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + | protos.google.cloud.channel.v1.IListPurchasableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableSku + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + | protos.google.cloud.channel.v1.IListPurchasableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableSku + > + ): Promise< + [ + protos.google.cloud.channel.v1.IPurchasableSku[], + protos.google.cloud.channel.v1.IListPurchasableSkusRequest | null, + protos.google.cloud.channel.v1.IListPurchasableSkusResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + this.initialize(); + return this.innerApiCalls.listPurchasableSkus(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} request.createEntitlementPurchase + * List SKUs for CreateEntitlement purchase. + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} request.changeOfferPurchase + * List SKUs for ChangeOffer purchase with a new SKU. + * @param {string} request.customer + * Required. The resource name of the customer to list SKUs for. + * Format: accounts/{account_id}/customers/{customer_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @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 [PurchasableSku]{@link google.cloud.channel.v1.PurchasableSku} 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 `listPurchasableSkusAsync()` + * 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. + */ + listPurchasableSkusStream( + request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + const defaultCallSettings = this._defaults['listPurchasableSkus']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPurchasableSkus.createStream( + this.innerApiCalls.listPurchasableSkus as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPurchasableSkus`, 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 {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} request.createEntitlementPurchase + * List SKUs for CreateEntitlement purchase. + * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.ChangeOfferPurchase} request.changeOfferPurchase + * List SKUs for ChangeOffer purchase with a new SKU. + * @param {string} request.customer + * Required. The resource name of the customer to list SKUs for. + * Format: accounts/{account_id}/customers/{customer_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 SKUs. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [PurchasableSku]{@link google.cloud.channel.v1.PurchasableSku}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_purchasable_skus.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async + */ + listPurchasableSkusAsync( + request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + const defaultCallSettings = this._defaults['listPurchasableSkus']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPurchasableSkus.asyncIterate( + this.innerApiCalls['listPurchasableSkus'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the following: + * + * * Offers that you can purchase for a customer. + * * Offers that you can change for an entitlement. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} request.createEntitlementPurchase + * List Offers for CreateEntitlement purchase. + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} request.changeOfferPurchase + * List Offers for ChangeOffer purchase. + * @param {string} request.customer + * Required. The resource name of the customer to list Offers for. + * Format: accounts/{account_id}/customers/{customer_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PurchasableOffer]{@link google.cloud.channel.v1.PurchasableOffer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPurchasableOffersAsync()` + * 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. + */ + listPurchasableOffers( + request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IPurchasableOffer[], + protos.google.cloud.channel.v1.IListPurchasableOffersRequest | null, + protos.google.cloud.channel.v1.IListPurchasableOffersResponse + ] + >; + listPurchasableOffers( + request: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + | protos.google.cloud.channel.v1.IListPurchasableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableOffer + > + ): void; + listPurchasableOffers( + request: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + | protos.google.cloud.channel.v1.IListPurchasableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableOffer + > + ): void; + listPurchasableOffers( + request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + | protos.google.cloud.channel.v1.IListPurchasableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableOffer + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + | protos.google.cloud.channel.v1.IListPurchasableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableOffer + > + ): Promise< + [ + protos.google.cloud.channel.v1.IPurchasableOffer[], + protos.google.cloud.channel.v1.IListPurchasableOffersRequest | null, + protos.google.cloud.channel.v1.IListPurchasableOffersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + this.initialize(); + return this.innerApiCalls.listPurchasableOffers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} request.createEntitlementPurchase + * List Offers for CreateEntitlement purchase. + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} request.changeOfferPurchase + * List Offers for ChangeOffer purchase. + * @param {string} request.customer + * Required. The resource name of the customer to list Offers for. + * Format: accounts/{account_id}/customers/{customer_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @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 [PurchasableOffer]{@link google.cloud.channel.v1.PurchasableOffer} 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 `listPurchasableOffersAsync()` + * 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. + */ + listPurchasableOffersStream( + request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + const defaultCallSettings = this._defaults['listPurchasableOffers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPurchasableOffers.createStream( + this.innerApiCalls.listPurchasableOffers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPurchasableOffers`, 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 {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} request.createEntitlementPurchase + * List Offers for CreateEntitlement purchase. + * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase} request.changeOfferPurchase + * List Offers for ChangeOffer purchase. + * @param {string} request.customer + * Required. The resource name of the customer to list Offers for. + * Format: accounts/{account_id}/customers/{customer_id}. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server might return fewer results than requested. + * If unspecified, returns at most 100 Offers. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A token for a page of results other than the first page. + * @param {string} [request.languageCode] + * Optional. The BCP-47 language code. For example, "en-US". The + * response will localize in the corresponding language code, if specified. + * The default value is "en-US". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [PurchasableOffer]{@link google.cloud.channel.v1.PurchasableOffer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_purchasable_offers.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async + */ + listPurchasableOffersAsync( + request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + customer: request.customer ?? '', + }); + const defaultCallSettings = this._defaults['listPurchasableOffers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPurchasableOffers.asyncIterate( + this.innerApiCalls['listPurchasableOffers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists service accounts with subscriber privileges on the Cloud Pub/Sub + * topic created for this Channel Services account. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The reseller account making the request and the + * provided reseller account are different, or the impersonated user + * is not a super admin. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * * NOT_FOUND: The topic resource doesn't exist. + * * INTERNAL: Any non-user error related to a technical issue in the + * backend. Contact Cloud Channel support. + * * UNKNOWN: Any non-user error related to a technical issue in the backend. + * Contact Cloud Channel support. + * + * Return value: + * A list of service email addresses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. Resource name of the account. + * @param {number} [request.pageSize] + * Optional. The maximum number of service accounts to return. The service may return + * fewer than this value. + * If unspecified, returns at most 100 service accounts. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of string. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSubscribersAsync()` + * 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. + */ + listSubscribers( + request?: protos.google.cloud.channel.v1.IListSubscribersRequest, + options?: CallOptions + ): Promise< + [ + string[], + protos.google.cloud.channel.v1.IListSubscribersRequest | null, + protos.google.cloud.channel.v1.IListSubscribersResponse + ] + >; + listSubscribers( + request: protos.google.cloud.channel.v1.IListSubscribersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListSubscribersRequest, + | protos.google.cloud.channel.v1.IListSubscribersResponse + | null + | undefined, + string + > + ): void; + listSubscribers( + request: protos.google.cloud.channel.v1.IListSubscribersRequest, + callback: PaginationCallback< + protos.google.cloud.channel.v1.IListSubscribersRequest, + | protos.google.cloud.channel.v1.IListSubscribersResponse + | null + | undefined, + string + > + ): void; + listSubscribers( + request?: protos.google.cloud.channel.v1.IListSubscribersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.channel.v1.IListSubscribersRequest, + | protos.google.cloud.channel.v1.IListSubscribersResponse + | null + | undefined, + string + >, + callback?: PaginationCallback< + protos.google.cloud.channel.v1.IListSubscribersRequest, + | protos.google.cloud.channel.v1.IListSubscribersResponse + | null + | undefined, + string + > + ): Promise< + [ + string[], + protos.google.cloud.channel.v1.IListSubscribersRequest | null, + protos.google.cloud.channel.v1.IListSubscribersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + account: request.account ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSubscribers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.account + * Required. Resource name of the account. + * @param {number} [request.pageSize] + * Optional. The maximum number of service accounts to return. The service may return + * fewer than this value. + * If unspecified, returns at most 100 service accounts. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing string 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 `listSubscribersAsync()` + * 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. + */ + listSubscribersStream( + request?: protos.google.cloud.channel.v1.IListSubscribersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + account: request.account ?? '', + }); + const defaultCallSettings = this._defaults['listSubscribers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubscribers.createStream( + this.innerApiCalls.listSubscribers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSubscribers`, 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.account + * Required. Resource name of the account. + * @param {number} [request.pageSize] + * Optional. The maximum number of service accounts to return. The service may return + * fewer than this value. + * If unspecified, returns at most 100 service accounts. + * The maximum value is 1000; the server will coerce values above 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSubscribers` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSubscribers` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * string. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/cloud_channel_service.list_subscribers.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async + */ + listSubscribersAsync( + request?: protos.google.cloud.channel.v1.IListSubscribersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + account: request.account ?? '', + }); + const defaultCallSettings = this._defaults['listSubscribers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubscribers.asyncIterate( + this.innerApiCalls['listSubscribers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified channelPartnerLink resource name string. + * + * @param {string} account + * @param {string} channel_partner_link + * @returns {string} Resource name string. + */ + channelPartnerLinkPath(account: string, channelPartnerLink: string) { + return this.pathTemplates.channelPartnerLinkPathTemplate.render({ + account: account, + channel_partner_link: channelPartnerLink, + }); + } + + /** + * Parse the account from ChannelPartnerLink resource. + * + * @param {string} channelPartnerLinkName + * A fully-qualified path representing ChannelPartnerLink resource. + * @returns {string} A string representing the account. + */ + matchAccountFromChannelPartnerLinkName(channelPartnerLinkName: string) { + return this.pathTemplates.channelPartnerLinkPathTemplate.match( + channelPartnerLinkName + ).account; + } + + /** + * Parse the channel_partner_link from ChannelPartnerLink resource. + * + * @param {string} channelPartnerLinkName + * A fully-qualified path representing ChannelPartnerLink resource. + * @returns {string} A string representing the channel_partner_link. + */ + matchChannelPartnerLinkFromChannelPartnerLinkName( + channelPartnerLinkName: string + ) { + return this.pathTemplates.channelPartnerLinkPathTemplate.match( + channelPartnerLinkName + ).channel_partner_link; + } + + /** + * Return a fully-qualified channelPartnerRepricingConfig resource name string. + * + * @param {string} account + * @param {string} channel_partner + * @param {string} channel_partner_repricing_config + * @returns {string} Resource name string. + */ + channelPartnerRepricingConfigPath( + account: string, + channelPartner: string, + channelPartnerRepricingConfig: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.render({ + account: account, + channel_partner: channelPartner, + channel_partner_repricing_config: channelPartnerRepricingConfig, + }); + } + + /** + * Parse the account from ChannelPartnerRepricingConfig resource. + * + * @param {string} channelPartnerRepricingConfigName + * A fully-qualified path representing ChannelPartnerRepricingConfig resource. + * @returns {string} A string representing the account. + */ + matchAccountFromChannelPartnerRepricingConfigName( + channelPartnerRepricingConfigName: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.match( + channelPartnerRepricingConfigName + ).account; + } + + /** + * Parse the channel_partner from ChannelPartnerRepricingConfig resource. + * + * @param {string} channelPartnerRepricingConfigName + * A fully-qualified path representing ChannelPartnerRepricingConfig resource. + * @returns {string} A string representing the channel_partner. + */ + matchChannelPartnerFromChannelPartnerRepricingConfigName( + channelPartnerRepricingConfigName: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.match( + channelPartnerRepricingConfigName + ).channel_partner; + } + + /** + * Parse the channel_partner_repricing_config from ChannelPartnerRepricingConfig resource. + * + * @param {string} channelPartnerRepricingConfigName + * A fully-qualified path representing ChannelPartnerRepricingConfig resource. + * @returns {string} A string representing the channel_partner_repricing_config. + */ + matchChannelPartnerRepricingConfigFromChannelPartnerRepricingConfigName( + channelPartnerRepricingConfigName: string + ) { + return this.pathTemplates.channelPartnerRepricingConfigPathTemplate.match( + channelPartnerRepricingConfigName + ).channel_partner_repricing_config; + } + + /** + * Return a fully-qualified customer resource name string. + * + * @param {string} account + * @param {string} customer + * @returns {string} Resource name string. + */ + customerPath(account: string, customer: string) { + return this.pathTemplates.customerPathTemplate.render({ + account: account, + customer: customer, + }); + } + + /** + * Parse the account from Customer resource. + * + * @param {string} customerName + * A fully-qualified path representing Customer resource. + * @returns {string} A string representing the account. + */ + matchAccountFromCustomerName(customerName: string) { + return this.pathTemplates.customerPathTemplate.match(customerName).account; + } + + /** + * Parse the customer from Customer resource. + * + * @param {string} customerName + * A fully-qualified path representing Customer resource. + * @returns {string} A string representing the customer. + */ + matchCustomerFromCustomerName(customerName: string) { + return this.pathTemplates.customerPathTemplate.match(customerName).customer; + } + + /** + * Return a fully-qualified customerRepricingConfig resource name string. + * + * @param {string} account + * @param {string} customer + * @param {string} customer_repricing_config + * @returns {string} Resource name string. + */ + customerRepricingConfigPath( + account: string, + customer: string, + customerRepricingConfig: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.render({ + account: account, + customer: customer, + customer_repricing_config: customerRepricingConfig, + }); + } + + /** + * Parse the account from CustomerRepricingConfig resource. + * + * @param {string} customerRepricingConfigName + * A fully-qualified path representing CustomerRepricingConfig resource. + * @returns {string} A string representing the account. + */ + matchAccountFromCustomerRepricingConfigName( + customerRepricingConfigName: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.match( + customerRepricingConfigName + ).account; + } + + /** + * Parse the customer from CustomerRepricingConfig resource. + * + * @param {string} customerRepricingConfigName + * A fully-qualified path representing CustomerRepricingConfig resource. + * @returns {string} A string representing the customer. + */ + matchCustomerFromCustomerRepricingConfigName( + customerRepricingConfigName: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.match( + customerRepricingConfigName + ).customer; + } + + /** + * Parse the customer_repricing_config from CustomerRepricingConfig resource. + * + * @param {string} customerRepricingConfigName + * A fully-qualified path representing CustomerRepricingConfig resource. + * @returns {string} A string representing the customer_repricing_config. + */ + matchCustomerRepricingConfigFromCustomerRepricingConfigName( + customerRepricingConfigName: string + ) { + return this.pathTemplates.customerRepricingConfigPathTemplate.match( + customerRepricingConfigName + ).customer_repricing_config; + } + + /** + * Return a fully-qualified entitlement resource name string. + * + * @param {string} account + * @param {string} customer + * @param {string} entitlement + * @returns {string} Resource name string. + */ + entitlementPath(account: string, customer: string, entitlement: string) { + return this.pathTemplates.entitlementPathTemplate.render({ + account: account, + customer: customer, + entitlement: entitlement, + }); + } + + /** + * Parse the account from Entitlement resource. + * + * @param {string} entitlementName + * A fully-qualified path representing Entitlement resource. + * @returns {string} A string representing the account. + */ + matchAccountFromEntitlementName(entitlementName: string) { + return this.pathTemplates.entitlementPathTemplate.match(entitlementName) + .account; + } + + /** + * Parse the customer from Entitlement resource. + * + * @param {string} entitlementName + * A fully-qualified path representing Entitlement resource. + * @returns {string} A string representing the customer. + */ + matchCustomerFromEntitlementName(entitlementName: string) { + return this.pathTemplates.entitlementPathTemplate.match(entitlementName) + .customer; + } + + /** + * Parse the entitlement from Entitlement resource. + * + * @param {string} entitlementName + * A fully-qualified path representing Entitlement resource. + * @returns {string} A string representing the entitlement. + */ + matchEntitlementFromEntitlementName(entitlementName: string) { + return this.pathTemplates.entitlementPathTemplate.match(entitlementName) + .entitlement; + } + + /** + * Return a fully-qualified offer resource name string. + * + * @param {string} account + * @param {string} offer + * @returns {string} Resource name string. + */ + offerPath(account: string, offer: string) { + return this.pathTemplates.offerPathTemplate.render({ + account: account, + offer: offer, + }); + } + + /** + * Parse the account from Offer resource. + * + * @param {string} offerName + * A fully-qualified path representing Offer resource. + * @returns {string} A string representing the account. + */ + matchAccountFromOfferName(offerName: string) { + return this.pathTemplates.offerPathTemplate.match(offerName).account; + } + + /** + * Parse the offer from Offer resource. + * + * @param {string} offerName + * A fully-qualified path representing Offer resource. + * @returns {string} A string representing the offer. + */ + matchOfferFromOfferName(offerName: string) { + return this.pathTemplates.offerPathTemplate.match(offerName).offer; + } + + /** + * Return a fully-qualified product resource name string. + * + * @param {string} product + * @returns {string} Resource name string. + */ + productPath(product: string) { + return this.pathTemplates.productPathTemplate.render({ + product: product, + }); + } + + /** + * Parse the product from Product resource. + * + * @param {string} productName + * A fully-qualified path representing Product resource. + * @returns {string} A string representing the product. + */ + matchProductFromProductName(productName: string) { + return this.pathTemplates.productPathTemplate.match(productName).product; + } + + /** + * Return a fully-qualified report resource name string. + * + * @param {string} account + * @param {string} report + * @returns {string} Resource name string. + */ + reportPath(account: string, report: string) { + return this.pathTemplates.reportPathTemplate.render({ + account: account, + report: report, + }); + } + + /** + * Parse the account from Report resource. + * + * @param {string} reportName + * A fully-qualified path representing Report resource. + * @returns {string} A string representing the account. + */ + matchAccountFromReportName(reportName: string) { + return this.pathTemplates.reportPathTemplate.match(reportName).account; + } + + /** + * Parse the report from Report resource. + * + * @param {string} reportName + * A fully-qualified path representing Report resource. + * @returns {string} A string representing the report. + */ + matchReportFromReportName(reportName: string) { + return this.pathTemplates.reportPathTemplate.match(reportName).report; + } + + /** + * Return a fully-qualified reportJob resource name string. + * + * @param {string} account + * @param {string} report_job + * @returns {string} Resource name string. + */ + reportJobPath(account: string, reportJob: string) { + return this.pathTemplates.reportJobPathTemplate.render({ + account: account, + report_job: reportJob, + }); + } + + /** + * Parse the account from ReportJob resource. + * + * @param {string} reportJobName + * A fully-qualified path representing ReportJob resource. + * @returns {string} A string representing the account. + */ + matchAccountFromReportJobName(reportJobName: string) { + return this.pathTemplates.reportJobPathTemplate.match(reportJobName) + .account; + } + + /** + * Parse the report_job from ReportJob resource. + * + * @param {string} reportJobName + * A fully-qualified path representing ReportJob resource. + * @returns {string} A string representing the report_job. + */ + matchReportJobFromReportJobName(reportJobName: string) { + return this.pathTemplates.reportJobPathTemplate.match(reportJobName) + .report_job; + } + + /** + * Return a fully-qualified sku resource name string. + * + * @param {string} product + * @param {string} sku + * @returns {string} Resource name string. + */ + skuPath(product: string, sku: string) { + return this.pathTemplates.skuPathTemplate.render({ + product: product, + sku: sku, + }); + } + + /** + * Parse the product from Sku resource. + * + * @param {string} skuName + * A fully-qualified path representing Sku resource. + * @returns {string} A string representing the product. + */ + matchProductFromSkuName(skuName: string) { + return this.pathTemplates.skuPathTemplate.match(skuName).product; + } + + /** + * Parse the sku from Sku resource. + * + * @param {string} skuName + * A fully-qualified path representing Sku resource. + * @returns {string} A string representing the sku. + */ + matchSkuFromSkuName(skuName: string) { + return this.pathTemplates.skuPathTemplate.match(skuName).sku; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.cloudChannelServiceStub && !this._terminated) { + return this.cloudChannelServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json b/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json new file mode 100644 index 00000000000..625117c33e1 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json @@ -0,0 +1,263 @@ +{ + "interfaces": { + "google.cloud.channel.v1.CloudChannelService": { + "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": { + "ListCustomers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCustomer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CheckCloudIdentityAccountsExist": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCustomer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateCustomer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteCustomer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ImportCustomer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ProvisionCloudIdentity": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEntitlements": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListTransferableSkus": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListTransferableOffers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ChangeParameters": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ChangeRenewalSettings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ChangeOffer": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartPaidService": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SuspendEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ActivateEntitlement": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TransferEntitlements": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TransferEntitlementsToGoogle": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListChannelPartnerLinks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetChannelPartnerLink": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateChannelPartnerLink": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateChannelPartnerLink": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCustomerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListCustomerRepricingConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCustomerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateCustomerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteCustomerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetChannelPartnerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListChannelPartnerRepricingConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateChannelPartnerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateChannelPartnerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteChannelPartnerRepricingConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "LookupOffer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListProducts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSkus": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListOffers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPurchasableSkus": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPurchasableOffers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "RegisterSubscriber": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UnregisterSubscriber": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSubscribers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json b/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json new file mode 100644 index 00000000000..aff1dcc4ca3 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/channel/v1/channel_partner_links.proto", + "../../protos/google/cloud/channel/v1/common.proto", + "../../protos/google/cloud/channel/v1/customers.proto", + "../../protos/google/cloud/channel/v1/entitlements.proto", + "../../protos/google/cloud/channel/v1/offers.proto", + "../../protos/google/cloud/channel/v1/operations.proto", + "../../protos/google/cloud/channel/v1/products.proto", + "../../protos/google/cloud/channel/v1/reports_service.proto", + "../../protos/google/cloud/channel/v1/repricing.proto", + "../../protos/google/cloud/channel/v1/service.proto", + "../../protos/google/cloud/channel/v1/subscriber_event.proto" +] diff --git a/packages/google-cloud-channel/src/v1/gapic_metadata.json b/packages/google-cloud-channel/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..ae5f1241294 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/gapic_metadata.json @@ -0,0 +1,577 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.channel.v1", + "libraryPackage": "@google-cloud/channel", + "services": { + "CloudChannelReportsService": { + "clients": { + "grpc": { + "libraryClient": "CloudChannelReportsServiceClient", + "rpcs": { + "RunReportJob": { + "methods": [ + "runReportJob" + ] + }, + "FetchReportResults": { + "methods": [ + "fetchReportResults", + "fetchReportResultsStream", + "fetchReportResultsAsync" + ] + }, + "ListReports": { + "methods": [ + "listReports", + "listReportsStream", + "listReportsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudChannelReportsServiceClient", + "rpcs": { + "RunReportJob": { + "methods": [ + "runReportJob" + ] + }, + "FetchReportResults": { + "methods": [ + "fetchReportResults", + "fetchReportResultsStream", + "fetchReportResultsAsync" + ] + }, + "ListReports": { + "methods": [ + "listReports", + "listReportsStream", + "listReportsAsync" + ] + } + } + } + } + }, + "CloudChannelService": { + "clients": { + "grpc": { + "libraryClient": "CloudChannelServiceClient", + "rpcs": { + "GetCustomer": { + "methods": [ + "getCustomer" + ] + }, + "CheckCloudIdentityAccountsExist": { + "methods": [ + "checkCloudIdentityAccountsExist" + ] + }, + "CreateCustomer": { + "methods": [ + "createCustomer" + ] + }, + "UpdateCustomer": { + "methods": [ + "updateCustomer" + ] + }, + "DeleteCustomer": { + "methods": [ + "deleteCustomer" + ] + }, + "ImportCustomer": { + "methods": [ + "importCustomer" + ] + }, + "GetEntitlement": { + "methods": [ + "getEntitlement" + ] + }, + "GetChannelPartnerLink": { + "methods": [ + "getChannelPartnerLink" + ] + }, + "CreateChannelPartnerLink": { + "methods": [ + "createChannelPartnerLink" + ] + }, + "UpdateChannelPartnerLink": { + "methods": [ + "updateChannelPartnerLink" + ] + }, + "GetCustomerRepricingConfig": { + "methods": [ + "getCustomerRepricingConfig" + ] + }, + "CreateCustomerRepricingConfig": { + "methods": [ + "createCustomerRepricingConfig" + ] + }, + "UpdateCustomerRepricingConfig": { + "methods": [ + "updateCustomerRepricingConfig" + ] + }, + "DeleteCustomerRepricingConfig": { + "methods": [ + "deleteCustomerRepricingConfig" + ] + }, + "GetChannelPartnerRepricingConfig": { + "methods": [ + "getChannelPartnerRepricingConfig" + ] + }, + "CreateChannelPartnerRepricingConfig": { + "methods": [ + "createChannelPartnerRepricingConfig" + ] + }, + "UpdateChannelPartnerRepricingConfig": { + "methods": [ + "updateChannelPartnerRepricingConfig" + ] + }, + "DeleteChannelPartnerRepricingConfig": { + "methods": [ + "deleteChannelPartnerRepricingConfig" + ] + }, + "LookupOffer": { + "methods": [ + "lookupOffer" + ] + }, + "RegisterSubscriber": { + "methods": [ + "registerSubscriber" + ] + }, + "UnregisterSubscriber": { + "methods": [ + "unregisterSubscriber" + ] + }, + "ProvisionCloudIdentity": { + "methods": [ + "provisionCloudIdentity" + ] + }, + "CreateEntitlement": { + "methods": [ + "createEntitlement" + ] + }, + "ChangeParameters": { + "methods": [ + "changeParameters" + ] + }, + "ChangeRenewalSettings": { + "methods": [ + "changeRenewalSettings" + ] + }, + "ChangeOffer": { + "methods": [ + "changeOffer" + ] + }, + "StartPaidService": { + "methods": [ + "startPaidService" + ] + }, + "SuspendEntitlement": { + "methods": [ + "suspendEntitlement" + ] + }, + "CancelEntitlement": { + "methods": [ + "cancelEntitlement" + ] + }, + "ActivateEntitlement": { + "methods": [ + "activateEntitlement" + ] + }, + "TransferEntitlements": { + "methods": [ + "transferEntitlements" + ] + }, + "TransferEntitlementsToGoogle": { + "methods": [ + "transferEntitlementsToGoogle" + ] + }, + "ListCustomers": { + "methods": [ + "listCustomers", + "listCustomersStream", + "listCustomersAsync" + ] + }, + "ListEntitlements": { + "methods": [ + "listEntitlements", + "listEntitlementsStream", + "listEntitlementsAsync" + ] + }, + "ListTransferableSkus": { + "methods": [ + "listTransferableSkus", + "listTransferableSkusStream", + "listTransferableSkusAsync" + ] + }, + "ListTransferableOffers": { + "methods": [ + "listTransferableOffers", + "listTransferableOffersStream", + "listTransferableOffersAsync" + ] + }, + "ListChannelPartnerLinks": { + "methods": [ + "listChannelPartnerLinks", + "listChannelPartnerLinksStream", + "listChannelPartnerLinksAsync" + ] + }, + "ListCustomerRepricingConfigs": { + "methods": [ + "listCustomerRepricingConfigs", + "listCustomerRepricingConfigsStream", + "listCustomerRepricingConfigsAsync" + ] + }, + "ListChannelPartnerRepricingConfigs": { + "methods": [ + "listChannelPartnerRepricingConfigs", + "listChannelPartnerRepricingConfigsStream", + "listChannelPartnerRepricingConfigsAsync" + ] + }, + "ListProducts": { + "methods": [ + "listProducts", + "listProductsStream", + "listProductsAsync" + ] + }, + "ListSkus": { + "methods": [ + "listSkus", + "listSkusStream", + "listSkusAsync" + ] + }, + "ListOffers": { + "methods": [ + "listOffers", + "listOffersStream", + "listOffersAsync" + ] + }, + "ListPurchasableSkus": { + "methods": [ + "listPurchasableSkus", + "listPurchasableSkusStream", + "listPurchasableSkusAsync" + ] + }, + "ListPurchasableOffers": { + "methods": [ + "listPurchasableOffers", + "listPurchasableOffersStream", + "listPurchasableOffersAsync" + ] + }, + "ListSubscribers": { + "methods": [ + "listSubscribers", + "listSubscribersStream", + "listSubscribersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudChannelServiceClient", + "rpcs": { + "GetCustomer": { + "methods": [ + "getCustomer" + ] + }, + "CheckCloudIdentityAccountsExist": { + "methods": [ + "checkCloudIdentityAccountsExist" + ] + }, + "CreateCustomer": { + "methods": [ + "createCustomer" + ] + }, + "UpdateCustomer": { + "methods": [ + "updateCustomer" + ] + }, + "DeleteCustomer": { + "methods": [ + "deleteCustomer" + ] + }, + "ImportCustomer": { + "methods": [ + "importCustomer" + ] + }, + "GetEntitlement": { + "methods": [ + "getEntitlement" + ] + }, + "GetChannelPartnerLink": { + "methods": [ + "getChannelPartnerLink" + ] + }, + "CreateChannelPartnerLink": { + "methods": [ + "createChannelPartnerLink" + ] + }, + "UpdateChannelPartnerLink": { + "methods": [ + "updateChannelPartnerLink" + ] + }, + "GetCustomerRepricingConfig": { + "methods": [ + "getCustomerRepricingConfig" + ] + }, + "CreateCustomerRepricingConfig": { + "methods": [ + "createCustomerRepricingConfig" + ] + }, + "UpdateCustomerRepricingConfig": { + "methods": [ + "updateCustomerRepricingConfig" + ] + }, + "DeleteCustomerRepricingConfig": { + "methods": [ + "deleteCustomerRepricingConfig" + ] + }, + "GetChannelPartnerRepricingConfig": { + "methods": [ + "getChannelPartnerRepricingConfig" + ] + }, + "CreateChannelPartnerRepricingConfig": { + "methods": [ + "createChannelPartnerRepricingConfig" + ] + }, + "UpdateChannelPartnerRepricingConfig": { + "methods": [ + "updateChannelPartnerRepricingConfig" + ] + }, + "DeleteChannelPartnerRepricingConfig": { + "methods": [ + "deleteChannelPartnerRepricingConfig" + ] + }, + "LookupOffer": { + "methods": [ + "lookupOffer" + ] + }, + "RegisterSubscriber": { + "methods": [ + "registerSubscriber" + ] + }, + "UnregisterSubscriber": { + "methods": [ + "unregisterSubscriber" + ] + }, + "ProvisionCloudIdentity": { + "methods": [ + "provisionCloudIdentity" + ] + }, + "CreateEntitlement": { + "methods": [ + "createEntitlement" + ] + }, + "ChangeParameters": { + "methods": [ + "changeParameters" + ] + }, + "ChangeRenewalSettings": { + "methods": [ + "changeRenewalSettings" + ] + }, + "ChangeOffer": { + "methods": [ + "changeOffer" + ] + }, + "StartPaidService": { + "methods": [ + "startPaidService" + ] + }, + "SuspendEntitlement": { + "methods": [ + "suspendEntitlement" + ] + }, + "CancelEntitlement": { + "methods": [ + "cancelEntitlement" + ] + }, + "ActivateEntitlement": { + "methods": [ + "activateEntitlement" + ] + }, + "TransferEntitlements": { + "methods": [ + "transferEntitlements" + ] + }, + "TransferEntitlementsToGoogle": { + "methods": [ + "transferEntitlementsToGoogle" + ] + }, + "ListCustomers": { + "methods": [ + "listCustomers", + "listCustomersStream", + "listCustomersAsync" + ] + }, + "ListEntitlements": { + "methods": [ + "listEntitlements", + "listEntitlementsStream", + "listEntitlementsAsync" + ] + }, + "ListTransferableSkus": { + "methods": [ + "listTransferableSkus", + "listTransferableSkusStream", + "listTransferableSkusAsync" + ] + }, + "ListTransferableOffers": { + "methods": [ + "listTransferableOffers", + "listTransferableOffersStream", + "listTransferableOffersAsync" + ] + }, + "ListChannelPartnerLinks": { + "methods": [ + "listChannelPartnerLinks", + "listChannelPartnerLinksStream", + "listChannelPartnerLinksAsync" + ] + }, + "ListCustomerRepricingConfigs": { + "methods": [ + "listCustomerRepricingConfigs", + "listCustomerRepricingConfigsStream", + "listCustomerRepricingConfigsAsync" + ] + }, + "ListChannelPartnerRepricingConfigs": { + "methods": [ + "listChannelPartnerRepricingConfigs", + "listChannelPartnerRepricingConfigsStream", + "listChannelPartnerRepricingConfigsAsync" + ] + }, + "ListProducts": { + "methods": [ + "listProducts", + "listProductsStream", + "listProductsAsync" + ] + }, + "ListSkus": { + "methods": [ + "listSkus", + "listSkusStream", + "listSkusAsync" + ] + }, + "ListOffers": { + "methods": [ + "listOffers", + "listOffersStream", + "listOffersAsync" + ] + }, + "ListPurchasableSkus": { + "methods": [ + "listPurchasableSkus", + "listPurchasableSkusStream", + "listPurchasableSkusAsync" + ] + }, + "ListPurchasableOffers": { + "methods": [ + "listPurchasableOffers", + "listPurchasableOffersStream", + "listPurchasableOffersAsync" + ] + }, + "ListSubscribers": { + "methods": [ + "listSubscribers", + "listSubscribersStream", + "listSubscribersAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-channel/src/v1/index.ts b/packages/google-cloud-channel/src/v1/index.ts new file mode 100644 index 00000000000..503f298a0d2 --- /dev/null +++ b/packages/google-cloud-channel/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CloudChannelReportsServiceClient} from './cloud_channel_reports_service_client'; +export {CloudChannelServiceClient} from './cloud_channel_service_client'; diff --git a/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..5503ca853ca --- /dev/null +++ b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 channel = require('@google-cloud/channel'); + +function main() { + const cloudChannelReportsServiceClient = + new channel.CloudChannelReportsServiceClient(); + const cloudChannelServiceClient = new channel.CloudChannelServiceClient(); +} + +main(); diff --git a/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..a520afaa4f5 --- /dev/null +++ b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,46 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 { + CloudChannelReportsServiceClient, + CloudChannelServiceClient, +} from '@google-cloud/channel'; + +// check that the client class type name can be used +function doStuffWithCloudChannelReportsServiceClient( + client: CloudChannelReportsServiceClient +) { + client.close(); +} +function doStuffWithCloudChannelServiceClient( + client: CloudChannelServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudChannelReportsServiceClient = + new CloudChannelReportsServiceClient(); + doStuffWithCloudChannelReportsServiceClient(cloudChannelReportsServiceClient); + // check that the client instance can be created + const cloudChannelServiceClient = new CloudChannelServiceClient(); + doStuffWithCloudChannelServiceClient(cloudChannelServiceClient); +} + +main(); diff --git a/packages/google-cloud-channel/system-test/install.ts b/packages/google-cloud-channel/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-channel/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts b/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts new file mode 100644 index 00000000000..b3775d0c9a7 --- /dev/null +++ b/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts @@ -0,0 +1,2070 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 cloudchannelreportsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.CloudChannelReportsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.cloudChannelReportsServiceStub, undefined); + await client.initialize(); + assert(client.cloudChannelReportsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.cloudChannelReportsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.cloudChannelReportsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + 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 cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + 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('runReportJob', () => { + it('invokes runReportJob without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RunReportJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RunReportJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runReportJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.runReportJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runReportJob without error using callback', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RunReportJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RunReportJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runReportJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runReportJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runReportJob with call error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RunReportJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RunReportJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runReportJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runReportJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runReportJob with LRO error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RunReportJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RunReportJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runReportJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runReportJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runReportJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunReportJobProgress without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + 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.checkRunReportJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunReportJobProgress with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + 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.checkRunReportJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('fetchReportResults', () => { + it('invokes fetchReportResults without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + ]; + client.innerApiCalls.fetchReportResults = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchReportResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchReportResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchReportResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchReportResults without error using callback', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + ]; + client.innerApiCalls.fetchReportResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchReportResults( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IRow[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchReportResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchReportResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchReportResults with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchReportResults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchReportResults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchReportResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchReportResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchReportResultsStream without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + ]; + client.descriptors.page.fetchReportResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.fetchReportResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Row[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Row) => { + 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.fetchReportResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.fetchReportResults, request) + ); + assert( + (client.descriptors.page.fetchReportResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchReportResultsStream with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchReportResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchReportResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Row[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Row) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.fetchReportResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.fetchReportResults, request) + ); + assert( + (client.descriptors.page.fetchReportResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchReportResults without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + generateSampleMessage(new protos.google.cloud.channel.v1.Row()), + ]; + client.descriptors.page.fetchReportResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IRow[] = []; + const iterable = client.fetchReportResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchReportResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.fetchReportResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchReportResults with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.FetchReportResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.FetchReportResultsRequest', + ['reportJob'] + ); + request.reportJob = defaultValue1; + const expectedHeaderRequestParams = `report_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchReportResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchReportResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IRow[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchReportResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.fetchReportResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listReports', () => { + it('invokes listReports without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + ]; + client.innerApiCalls.listReports = stubSimpleCall(expectedResponse); + const [response] = await client.listReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReports without error using callback', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + ]; + client.innerApiCalls.listReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReports( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IReport[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReports with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReports(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReportsStream without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + ]; + client.descriptors.page.listReports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Report[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Report) => { + 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.listReports.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReports, request) + ); + assert( + (client.descriptors.page.listReports.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listReportsStream with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReports.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Report[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Report) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReports.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReports, request) + ); + assert( + (client.descriptors.page.listReports.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReports without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + generateSampleMessage(new protos.google.cloud.channel.v1.Report()), + ]; + client.descriptors.page.listReports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IReport[] = []; + const iterable = client.listReportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listReports.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listReports.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReports with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReports.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listReportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IReport[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listReports.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listReports.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('channelPartnerLink', () => { + const fakePath = '/rendered/path/channelPartnerLink'; + const expectedParameters = { + account: 'accountValue', + channel_partner_link: 'channelPartnerLinkValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.channelPartnerLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPartnerLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPartnerLinkPath', () => { + const result = client.channelPartnerLinkPath( + 'accountValue', + 'channelPartnerLinkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.channelPartnerLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromChannelPartnerLinkName', () => { + const result = client.matchAccountFromChannelPartnerLinkName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.channelPartnerLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelPartnerLinkFromChannelPartnerLinkName', () => { + const result = + client.matchChannelPartnerLinkFromChannelPartnerLinkName(fakePath); + assert.strictEqual(result, 'channelPartnerLinkValue'); + assert( + ( + client.pathTemplates.channelPartnerLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('channelPartnerRepricingConfig', () => { + const fakePath = '/rendered/path/channelPartnerRepricingConfig'; + const expectedParameters = { + account: 'accountValue', + channel_partner: 'channelPartnerValue', + channel_partner_repricing_config: 'channelPartnerRepricingConfigValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.channelPartnerRepricingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.channelPartnerRepricingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('channelPartnerRepricingConfigPath', () => { + const result = client.channelPartnerRepricingConfigPath( + 'accountValue', + 'channelPartnerValue', + 'channelPartnerRepricingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromChannelPartnerRepricingConfigName', () => { + const result = + client.matchAccountFromChannelPartnerRepricingConfigName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelPartnerFromChannelPartnerRepricingConfigName', () => { + const result = + client.matchChannelPartnerFromChannelPartnerRepricingConfigName( + fakePath + ); + assert.strictEqual(result, 'channelPartnerValue'); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelPartnerRepricingConfigFromChannelPartnerRepricingConfigName', () => { + const result = + client.matchChannelPartnerRepricingConfigFromChannelPartnerRepricingConfigName( + fakePath + ); + assert.strictEqual(result, 'channelPartnerRepricingConfigValue'); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customer', () => { + const fakePath = '/rendered/path/customer'; + const expectedParameters = { + account: 'accountValue', + customer: 'customerValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.customerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customerPath', () => { + const result = client.customerPath('accountValue', 'customerValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromCustomerName', () => { + const result = client.matchAccountFromCustomerName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.customerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerFromCustomerName', () => { + const result = client.matchCustomerFromCustomerName(fakePath); + assert.strictEqual(result, 'customerValue'); + assert( + (client.pathTemplates.customerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customerRepricingConfig', () => { + const fakePath = '/rendered/path/customerRepricingConfig'; + const expectedParameters = { + account: 'accountValue', + customer: 'customerValue', + customer_repricing_config: 'customerRepricingConfigValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.customerRepricingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customerRepricingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customerRepricingConfigPath', () => { + const result = client.customerRepricingConfigPath( + 'accountValue', + 'customerValue', + 'customerRepricingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromCustomerRepricingConfigName', () => { + const result = + client.matchAccountFromCustomerRepricingConfigName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerFromCustomerRepricingConfigName', () => { + const result = + client.matchCustomerFromCustomerRepricingConfigName(fakePath); + assert.strictEqual(result, 'customerValue'); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerRepricingConfigFromCustomerRepricingConfigName', () => { + const result = + client.matchCustomerRepricingConfigFromCustomerRepricingConfigName( + fakePath + ); + assert.strictEqual(result, 'customerRepricingConfigValue'); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entitlement', () => { + const fakePath = '/rendered/path/entitlement'; + const expectedParameters = { + account: 'accountValue', + customer: 'customerValue', + entitlement: 'entitlementValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entitlementPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entitlementPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entitlementPath', () => { + const result = client.entitlementPath( + 'accountValue', + 'customerValue', + 'entitlementValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entitlementPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromEntitlementName', () => { + const result = client.matchAccountFromEntitlementName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.entitlementPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerFromEntitlementName', () => { + const result = client.matchCustomerFromEntitlementName(fakePath); + assert.strictEqual(result, 'customerValue'); + assert( + (client.pathTemplates.entitlementPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntitlementFromEntitlementName', () => { + const result = client.matchEntitlementFromEntitlementName(fakePath); + assert.strictEqual(result, 'entitlementValue'); + assert( + (client.pathTemplates.entitlementPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('offer', () => { + const fakePath = '/rendered/path/offer'; + const expectedParameters = { + account: 'accountValue', + offer: 'offerValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.offerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.offerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('offerPath', () => { + const result = client.offerPath('accountValue', 'offerValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.offerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromOfferName', () => { + const result = client.matchAccountFromOfferName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.offerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOfferFromOfferName', () => { + const result = client.matchOfferFromOfferName(fakePath); + assert.strictEqual(result, 'offerValue'); + assert( + (client.pathTemplates.offerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('product', () => { + const fakePath = '/rendered/path/product'; + const expectedParameters = { + product: 'productValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.productPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.productPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('productPath', () => { + const result = client.productPath('productValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.productPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProductFromProductName', () => { + const result = client.matchProductFromProductName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('report', () => { + const fakePath = '/rendered/path/report'; + const expectedParameters = { + account: 'accountValue', + report: 'reportValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reportPath', () => { + const result = client.reportPath('accountValue', 'reportValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reportPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromReportName', () => { + const result = client.matchAccountFromReportName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.reportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReportFromReportName', () => { + const result = client.matchReportFromReportName(fakePath); + assert.strictEqual(result, 'reportValue'); + assert( + (client.pathTemplates.reportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reportJob', () => { + const fakePath = '/rendered/path/reportJob'; + const expectedParameters = { + account: 'accountValue', + report_job: 'reportJobValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reportJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reportJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reportJobPath', () => { + const result = client.reportJobPath('accountValue', 'reportJobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reportJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromReportJobName', () => { + const result = client.matchAccountFromReportJobName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.reportJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReportJobFromReportJobName', () => { + const result = client.matchReportJobFromReportJobName(fakePath); + assert.strictEqual(result, 'reportJobValue'); + assert( + (client.pathTemplates.reportJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('sku', () => { + const fakePath = '/rendered/path/sku'; + const expectedParameters = { + product: 'productValue', + sku: 'skuValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.skuPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.skuPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('skuPath', () => { + const result = client.skuPath('productValue', 'skuValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.skuPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProductFromSkuName', () => { + const result = client.matchProductFromSkuName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.skuPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSkuFromSkuName', () => { + const result = client.matchSkuFromSkuName(fakePath); + assert.strictEqual(result, 'skuValue'); + assert( + (client.pathTemplates.skuPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts b/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts new file mode 100644 index 00000000000..5b3e634dad5 --- /dev/null +++ b/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts @@ -0,0 +1,10769 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 cloudchannelserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.CloudChannelServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudchannelserviceModule.v1.CloudChannelServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudchannelserviceModule.v1.CloudChannelServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudchannelserviceModule.v1.CloudChannelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new cloudchannelserviceModule.v1.CloudChannelServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.cloudChannelServiceStub, undefined); + await client.initialize(); + assert(client.cloudChannelServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.cloudChannelServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.cloudChannelServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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 cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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('getCustomer', () => { + it('invokes getCustomer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.getCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.getCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.getCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomer with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomer with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCustomer(request), expectedError); + }); + }); + + describe('checkCloudIdentityAccountsExist', () => { + it('invokes checkCloudIdentityAccountsExist without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse() + ); + client.innerApiCalls.checkCloudIdentityAccountsExist = + stubSimpleCall(expectedResponse); + const [response] = await client.checkCloudIdentityAccountsExist(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkCloudIdentityAccountsExist as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkCloudIdentityAccountsExist as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCloudIdentityAccountsExist without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CheckCloudIdentityAccountsExistResponse() + ); + client.innerApiCalls.checkCloudIdentityAccountsExist = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkCloudIdentityAccountsExist( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.checkCloudIdentityAccountsExist as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkCloudIdentityAccountsExist as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCloudIdentityAccountsExist with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkCloudIdentityAccountsExist = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCloudIdentityAccountsExist(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.checkCloudIdentityAccountsExist as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkCloudIdentityAccountsExist as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCloudIdentityAccountsExist with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CheckCloudIdentityAccountsExistRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.checkCloudIdentityAccountsExist(request), + expectedError + ); + }); + }); + + describe('createCustomer', () => { + it('invokes createCustomer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.createCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.createCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomer with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomer with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCustomer(request), expectedError); + }); + }); + + describe('updateCustomer', () => { + it('invokes updateCustomer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedHeaderRequestParams = `customer.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.updateCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedHeaderRequestParams = `customer.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.updateCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomer with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedHeaderRequestParams = `customer.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomer with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCustomer(request), expectedError); + }); + }); + + describe('deleteCustomer', () => { + it('invokes deleteCustomer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomer( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomer with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomer with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCustomer(request), expectedError); + }); + }); + + describe('importCustomer', () => { + it('invokes importCustomer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ImportCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ImportCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.importCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.importCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCustomer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ImportCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ImportCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Customer() + ); + client.innerApiCalls.importCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importCustomer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCustomer with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ImportCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ImportCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.importCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importCustomer with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ImportCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ImportCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importCustomer(request), expectedError); + }); + }); + + describe('getEntitlement', () => { + it('invokes getEntitlement without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Entitlement() + ); + client.innerApiCalls.getEntitlement = stubSimpleCall(expectedResponse); + const [response] = await client.getEntitlement(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntitlement without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Entitlement() + ); + client.innerApiCalls.getEntitlement = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEntitlement( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IEntitlement | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntitlement with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntitlement = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEntitlement(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEntitlement with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEntitlement(request), expectedError); + }); + }); + + describe('getChannelPartnerLink', () => { + it('invokes getChannelPartnerLink without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ); + client.innerApiCalls.getChannelPartnerLink = + stubSimpleCall(expectedResponse); + const [response] = await client.getChannelPartnerLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannelPartnerLink without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ); + client.innerApiCalls.getChannelPartnerLink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChannelPartnerLink( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerLink | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannelPartnerLink with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChannelPartnerLink = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getChannelPartnerLink(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannelPartnerLink with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getChannelPartnerLink(request), + expectedError + ); + }); + }); + + describe('createChannelPartnerLink', () => { + it('invokes createChannelPartnerLink without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerLinkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ); + client.innerApiCalls.createChannelPartnerLink = + stubSimpleCall(expectedResponse); + const [response] = await client.createChannelPartnerLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannelPartnerLink without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerLinkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ); + client.innerApiCalls.createChannelPartnerLink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createChannelPartnerLink( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerLink | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannelPartnerLink with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerLinkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChannelPartnerLink = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createChannelPartnerLink(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannelPartnerLink with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerLinkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createChannelPartnerLink(request), + expectedError + ); + }); + }); + + describe('updateChannelPartnerLink', () => { + it('invokes updateChannelPartnerLink without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ); + client.innerApiCalls.updateChannelPartnerLink = + stubSimpleCall(expectedResponse); + const [response] = await client.updateChannelPartnerLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannelPartnerLink without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ); + client.innerApiCalls.updateChannelPartnerLink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateChannelPartnerLink( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerLink | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannelPartnerLink with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChannelPartnerLink = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateChannelPartnerLink(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateChannelPartnerLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannelPartnerLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannelPartnerLink with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerLinkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateChannelPartnerLink(request), + expectedError + ); + }); + }); + + describe('getCustomerRepricingConfig', () => { + it('invokes getCustomerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ); + client.innerApiCalls.getCustomerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getCustomerRepricingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ); + client.innerApiCalls.getCustomerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCustomerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomerRepricingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getCustomerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCustomerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getCustomerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('createCustomerRepricingConfig', () => { + it('invokes createCustomerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ); + client.innerApiCalls.createCustomerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createCustomerRepricingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ); + client.innerApiCalls.createCustomerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomerRepricingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createCustomerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateCustomerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createCustomerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('updateCustomerRepricingConfig', () => { + it('invokes updateCustomerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest() + ); + request.customerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest', + ['customerRepricingConfig', 'name'] + ); + request.customerRepricingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `customer_repricing_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ); + client.innerApiCalls.updateCustomerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomerRepricingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest() + ); + request.customerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest', + ['customerRepricingConfig', 'name'] + ); + request.customerRepricingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `customer_repricing_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ); + client.innerApiCalls.updateCustomerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomerRepricingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest() + ); + request.customerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest', + ['customerRepricingConfig', 'name'] + ); + request.customerRepricingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `customer_repricing_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateCustomerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest() + ); + request.customerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateCustomerRepricingConfigRequest', + ['customerRepricingConfig', 'name'] + ); + request.customerRepricingConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateCustomerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('deleteCustomerRepricingConfig', () => { + it('invokes deleteCustomerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomerRepricingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteCustomerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteCustomerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteCustomerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteCustomerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('getChannelPartnerRepricingConfig', () => { + it('invokes getChannelPartnerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ); + client.innerApiCalls.getChannelPartnerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getChannelPartnerRepricingConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannelPartnerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ); + client.innerApiCalls.getChannelPartnerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChannelPartnerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannelPartnerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChannelPartnerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getChannelPartnerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChannelPartnerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.GetChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getChannelPartnerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('createChannelPartnerRepricingConfig', () => { + it('invokes createChannelPartnerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ); + client.innerApiCalls.createChannelPartnerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.createChannelPartnerRepricingConfig( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannelPartnerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ); + client.innerApiCalls.createChannelPartnerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createChannelPartnerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannelPartnerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChannelPartnerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createChannelPartnerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChannelPartnerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateChannelPartnerRepricingConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createChannelPartnerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('updateChannelPartnerRepricingConfig', () => { + it('invokes updateChannelPartnerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest() + ); + request.channelPartnerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest', + ['channelPartnerRepricingConfig', 'name'] + ); + request.channelPartnerRepricingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `channel_partner_repricing_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ); + client.innerApiCalls.updateChannelPartnerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateChannelPartnerRepricingConfig( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannelPartnerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest() + ); + request.channelPartnerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest', + ['channelPartnerRepricingConfig', 'name'] + ); + request.channelPartnerRepricingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `channel_partner_repricing_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ); + client.innerApiCalls.updateChannelPartnerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateChannelPartnerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannelPartnerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest() + ); + request.channelPartnerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest', + ['channelPartnerRepricingConfig', 'name'] + ); + request.channelPartnerRepricingConfig.name = defaultValue1; + const expectedHeaderRequestParams = `channel_partner_repricing_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChannelPartnerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateChannelPartnerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChannelPartnerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest() + ); + request.channelPartnerRepricingConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UpdateChannelPartnerRepricingConfigRequest', + ['channelPartnerRepricingConfig', 'name'] + ); + request.channelPartnerRepricingConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateChannelPartnerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('deleteChannelPartnerRepricingConfig', () => { + it('invokes deleteChannelPartnerRepricingConfig without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteChannelPartnerRepricingConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteChannelPartnerRepricingConfig( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannelPartnerRepricingConfig without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteChannelPartnerRepricingConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteChannelPartnerRepricingConfig( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannelPartnerRepricingConfig with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteChannelPartnerRepricingConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteChannelPartnerRepricingConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChannelPartnerRepricingConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChannelPartnerRepricingConfig with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.DeleteChannelPartnerRepricingConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteChannelPartnerRepricingConfig(request), + expectedError + ); + }); + }); + + describe('lookupOffer', () => { + it('invokes lookupOffer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.LookupOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.LookupOfferRequest', + ['entitlement'] + ); + request.entitlement = defaultValue1; + const expectedHeaderRequestParams = `entitlement=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Offer() + ); + client.innerApiCalls.lookupOffer = stubSimpleCall(expectedResponse); + const [response] = await client.lookupOffer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupOffer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.LookupOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.LookupOfferRequest', + ['entitlement'] + ); + request.entitlement = defaultValue1; + const expectedHeaderRequestParams = `entitlement=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.Offer() + ); + client.innerApiCalls.lookupOffer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookupOffer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IOffer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.lookupOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupOffer with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.LookupOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.LookupOfferRequest', + ['entitlement'] + ); + request.entitlement = defaultValue1; + const expectedHeaderRequestParams = `entitlement=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupOffer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.lookupOffer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.lookupOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes lookupOffer with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.LookupOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.LookupOfferRequest', + ['entitlement'] + ); + request.entitlement = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookupOffer(request), expectedError); + }); + }); + + describe('registerSubscriber', () => { + it('invokes registerSubscriber without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RegisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RegisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.RegisterSubscriberResponse() + ); + client.innerApiCalls.registerSubscriber = + stubSimpleCall(expectedResponse); + const [response] = await client.registerSubscriber(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.registerSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes registerSubscriber without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RegisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RegisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.RegisterSubscriberResponse() + ); + client.innerApiCalls.registerSubscriber = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.registerSubscriber( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IRegisterSubscriberResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.registerSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes registerSubscriber with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RegisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RegisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.registerSubscriber = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.registerSubscriber(request), expectedError); + const actualRequest = ( + client.innerApiCalls.registerSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.registerSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes registerSubscriber with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.RegisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.RegisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.registerSubscriber(request), expectedError); + }); + }); + + describe('unregisterSubscriber', () => { + it('invokes unregisterSubscriber without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UnregisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UnregisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.UnregisterSubscriberResponse() + ); + client.innerApiCalls.unregisterSubscriber = + stubSimpleCall(expectedResponse); + const [response] = await client.unregisterSubscriber(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.unregisterSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.unregisterSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes unregisterSubscriber without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UnregisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UnregisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.UnregisterSubscriberResponse() + ); + client.innerApiCalls.unregisterSubscriber = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.unregisterSubscriber( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IUnregisterSubscriberResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.unregisterSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.unregisterSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes unregisterSubscriber with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UnregisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UnregisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.unregisterSubscriber = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.unregisterSubscriber(request), expectedError); + const actualRequest = ( + client.innerApiCalls.unregisterSubscriber as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.unregisterSubscriber as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes unregisterSubscriber with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.UnregisterSubscriberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.UnregisterSubscriberRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.unregisterSubscriber(request), expectedError); + }); + }); + + describe('provisionCloudIdentity', () => { + it('invokes provisionCloudIdentity without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ProvisionCloudIdentityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ProvisionCloudIdentityRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.provisionCloudIdentity = + stubLongRunningCall(expectedResponse); + const [operation] = await client.provisionCloudIdentity(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes provisionCloudIdentity without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ProvisionCloudIdentityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ProvisionCloudIdentityRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.provisionCloudIdentity = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.provisionCloudIdentity( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes provisionCloudIdentity with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ProvisionCloudIdentityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ProvisionCloudIdentityRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.provisionCloudIdentity = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.provisionCloudIdentity(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes provisionCloudIdentity with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ProvisionCloudIdentityRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ProvisionCloudIdentityRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.provisionCloudIdentity = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.provisionCloudIdentity(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.provisionCloudIdentity as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkProvisionCloudIdentityProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkProvisionCloudIdentityProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkProvisionCloudIdentityProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkProvisionCloudIdentityProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createEntitlement', () => { + it('invokes createEntitlement without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateEntitlementRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEntitlement = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createEntitlement(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntitlement without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateEntitlementRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEntitlement = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEntitlement( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntitlement with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateEntitlementRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntitlement = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createEntitlement(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEntitlement with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CreateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CreateEntitlementRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntitlement = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createEntitlement(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEntitlementProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkCreateEntitlementProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEntitlementProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkCreateEntitlementProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('changeParameters', () => { + it('invokes changeParameters without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.changeParameters = + stubLongRunningCall(expectedResponse); + const [operation] = await client.changeParameters(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeParameters without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.changeParameters = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.changeParameters( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeParameters with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.changeParameters = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.changeParameters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeParameters with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeParametersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeParametersRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.changeParameters = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.changeParameters(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeParameters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkChangeParametersProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkChangeParametersProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkChangeParametersProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkChangeParametersProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('changeRenewalSettings', () => { + it('invokes changeRenewalSettings without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeRenewalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeRenewalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.changeRenewalSettings = + stubLongRunningCall(expectedResponse); + const [operation] = await client.changeRenewalSettings(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeRenewalSettings without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeRenewalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeRenewalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.changeRenewalSettings = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.changeRenewalSettings( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeRenewalSettings with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeRenewalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeRenewalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.changeRenewalSettings = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.changeRenewalSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeRenewalSettings with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeRenewalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeRenewalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.changeRenewalSettings = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.changeRenewalSettings(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeRenewalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkChangeRenewalSettingsProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkChangeRenewalSettingsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkChangeRenewalSettingsProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkChangeRenewalSettingsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('changeOffer', () => { + it('invokes changeOffer without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeOfferRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.changeOffer = stubLongRunningCall(expectedResponse); + const [operation] = await client.changeOffer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeOffer without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeOfferRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.changeOffer = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.changeOffer( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeOffer with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeOfferRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.changeOffer = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.changeOffer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes changeOffer with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ChangeOfferRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ChangeOfferRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.changeOffer = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.changeOffer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.changeOffer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkChangeOfferProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkChangeOfferProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkChangeOfferProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkChangeOfferProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('startPaidService', () => { + it('invokes startPaidService without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.StartPaidServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.StartPaidServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startPaidService = + stubLongRunningCall(expectedResponse); + const [operation] = await client.startPaidService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startPaidService without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.StartPaidServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.StartPaidServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startPaidService = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startPaidService( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startPaidService with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.StartPaidServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.StartPaidServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startPaidService = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.startPaidService(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startPaidService with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.StartPaidServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.StartPaidServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startPaidService = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.startPaidService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startPaidService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartPaidServiceProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkStartPaidServiceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartPaidServiceProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkStartPaidServiceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('suspendEntitlement', () => { + it('invokes suspendEntitlement without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.SuspendEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.SuspendEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.suspendEntitlement = + stubLongRunningCall(expectedResponse); + const [operation] = await client.suspendEntitlement(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes suspendEntitlement without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.SuspendEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.SuspendEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.suspendEntitlement = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.suspendEntitlement( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes suspendEntitlement with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.SuspendEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.SuspendEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.suspendEntitlement = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.suspendEntitlement(request), expectedError); + const actualRequest = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes suspendEntitlement with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.SuspendEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.SuspendEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.suspendEntitlement = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.suspendEntitlement(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suspendEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSuspendEntitlementProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkSuspendEntitlementProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSuspendEntitlementProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkSuspendEntitlementProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('cancelEntitlement', () => { + it('invokes cancelEntitlement without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CancelEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CancelEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelEntitlement = + stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelEntitlement(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelEntitlement without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CancelEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CancelEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelEntitlement = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelEntitlement( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelEntitlement with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CancelEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CancelEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelEntitlement = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelEntitlement(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelEntitlement with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.CancelEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.CancelEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelEntitlement = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.cancelEntitlement(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelEntitlementProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkCancelEntitlementProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelEntitlementProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkCancelEntitlementProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('activateEntitlement', () => { + it('invokes activateEntitlement without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ActivateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ActivateEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.activateEntitlement = + stubLongRunningCall(expectedResponse); + const [operation] = await client.activateEntitlement(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateEntitlement without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ActivateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ActivateEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.activateEntitlement = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.activateEntitlement( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateEntitlement with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ActivateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ActivateEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.activateEntitlement = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.activateEntitlement(request), expectedError); + const actualRequest = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes activateEntitlement with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ActivateEntitlementRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ActivateEntitlementRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.activateEntitlement = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.activateEntitlement(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.activateEntitlement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkActivateEntitlementProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkActivateEntitlementProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkActivateEntitlementProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkActivateEntitlementProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('transferEntitlements', () => { + it('invokes transferEntitlements without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.transferEntitlements = + stubLongRunningCall(expectedResponse); + const [operation] = await client.transferEntitlements(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferEntitlements without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.transferEntitlements = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.transferEntitlements( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferEntitlements with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.transferEntitlements = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.transferEntitlements(request), expectedError); + const actualRequest = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferEntitlements with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.transferEntitlements = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.transferEntitlements(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTransferEntitlementsProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkTransferEntitlementsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTransferEntitlementsProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkTransferEntitlementsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('transferEntitlementsToGoogle', () => { + it('invokes transferEntitlementsToGoogle without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.transferEntitlementsToGoogle = + stubLongRunningCall(expectedResponse); + const [operation] = await client.transferEntitlementsToGoogle(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferEntitlementsToGoogle without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.transferEntitlementsToGoogle = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.transferEntitlementsToGoogle( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferEntitlementsToGoogle with call error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.transferEntitlementsToGoogle = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.transferEntitlementsToGoogle(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferEntitlementsToGoogle with LRO error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.TransferEntitlementsToGoogleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.transferEntitlementsToGoogle = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.transferEntitlementsToGoogle(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferEntitlementsToGoogle as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTransferEntitlementsToGoogleProgress without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkTransferEntitlementsToGoogleProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTransferEntitlementsToGoogleProgress with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + 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.checkTransferEntitlementsToGoogleProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listCustomers', () => { + it('invokes listCustomers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + ]; + client.innerApiCalls.listCustomers = stubSimpleCall(expectedResponse); + const [response] = await client.listCustomers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCustomers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomers without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + ]; + client.innerApiCalls.listCustomers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ICustomer[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCustomers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCustomers(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCustomers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomersStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + ]; + client.descriptors.page.listCustomers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCustomersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Customer[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.Customer) => { + 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.listCustomers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCustomers, request) + ); + assert( + (client.descriptors.page.listCustomers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomersStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Customer[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.Customer) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCustomers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCustomers, request) + ); + assert( + (client.descriptors.page.listCustomers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Customer()), + ]; + client.descriptors.page.listCustomers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.ICustomer[] = []; + const iterable = client.listCustomersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCustomers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCustomers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.ICustomer[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCustomers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCustomers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEntitlements', () => { + it('invokes listEntitlements without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + ]; + client.innerApiCalls.listEntitlements = stubSimpleCall(expectedResponse); + const [response] = await client.listEntitlements(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntitlements without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + ]; + client.innerApiCalls.listEntitlements = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEntitlements( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IEntitlement[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntitlements with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntitlements = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEntitlements(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEntitlements as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntitlements as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEntitlementsStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + ]; + client.descriptors.page.listEntitlements.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEntitlementsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Entitlement[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.Entitlement) => { + 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.listEntitlements.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntitlements, request) + ); + assert( + (client.descriptors.page.listEntitlements.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEntitlementsStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntitlements.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEntitlementsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Entitlement[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.Entitlement) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEntitlements.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEntitlements, request) + ); + assert( + (client.descriptors.page.listEntitlements.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEntitlements without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + generateSampleMessage(new protos.google.cloud.channel.v1.Entitlement()), + ]; + client.descriptors.page.listEntitlements.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IEntitlement[] = []; + const iterable = client.listEntitlementsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntitlements.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEntitlements.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEntitlements with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListEntitlementsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListEntitlementsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEntitlements.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEntitlementsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IEntitlement[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEntitlements.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEntitlements.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferableSkus', () => { + it('invokes listTransferableSkus without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + ]; + client.innerApiCalls.listTransferableSkus = + stubSimpleCall(expectedResponse); + const [response] = await client.listTransferableSkus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferableSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferableSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferableSkus without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + ]; + client.innerApiCalls.listTransferableSkus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferableSkus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ITransferableSku[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferableSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferableSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferableSkus with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferableSkus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTransferableSkus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTransferableSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferableSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferableSkusStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + ]; + client.descriptors.page.listTransferableSkus.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferableSkusStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.TransferableSku[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.TransferableSku) => { + 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.listTransferableSkus.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferableSkus, request) + ); + assert( + (client.descriptors.page.listTransferableSkus.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferableSkusStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferableSkus.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferableSkusStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.TransferableSku[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.TransferableSku) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTransferableSkus.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferableSkus, request) + ); + assert( + (client.descriptors.page.listTransferableSkus.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferableSkus without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableSku() + ), + ]; + client.descriptors.page.listTransferableSkus.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.ITransferableSku[] = []; + const iterable = client.listTransferableSkusAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferableSkus.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferableSkus.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferableSkus with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferableSkus.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferableSkusAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.ITransferableSku[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferableSkus.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTransferableSkus.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTransferableOffers', () => { + it('invokes listTransferableOffers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + ]; + client.innerApiCalls.listTransferableOffers = + stubSimpleCall(expectedResponse); + const [response] = await client.listTransferableOffers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferableOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferableOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferableOffers without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + ]; + client.innerApiCalls.listTransferableOffers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTransferableOffers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ITransferableOffer[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTransferableOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferableOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferableOffers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTransferableOffers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listTransferableOffers(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listTransferableOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTransferableOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTransferableOffersStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + ]; + client.descriptors.page.listTransferableOffers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTransferableOffersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.TransferableOffer[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.TransferableOffer) => { + 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.listTransferableOffers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferableOffers, request) + ); + assert( + ( + client.descriptors.page.listTransferableOffers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTransferableOffersStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferableOffers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTransferableOffersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.TransferableOffer[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.TransferableOffer) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listTransferableOffers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listTransferableOffers, request) + ); + assert( + ( + client.descriptors.page.listTransferableOffers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferableOffers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.TransferableOffer() + ), + ]; + client.descriptors.page.listTransferableOffers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.ITransferableOffer[] = []; + const iterable = client.listTransferableOffersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferableOffers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listTransferableOffers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTransferableOffers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListTransferableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListTransferableOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTransferableOffers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTransferableOffersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.ITransferableOffer[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTransferableOffers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listTransferableOffers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listChannelPartnerLinks', () => { + it('invokes listChannelPartnerLinks without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + ]; + client.innerApiCalls.listChannelPartnerLinks = + stubSimpleCall(expectedResponse); + const [response] = await client.listChannelPartnerLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChannelPartnerLinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannelPartnerLinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelPartnerLinks without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + ]; + client.innerApiCalls.listChannelPartnerLinks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChannelPartnerLinks( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IChannelPartnerLink[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChannelPartnerLinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannelPartnerLinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelPartnerLinks with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChannelPartnerLinks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listChannelPartnerLinks(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listChannelPartnerLinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannelPartnerLinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelPartnerLinksStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + ]; + client.descriptors.page.listChannelPartnerLinks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listChannelPartnerLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.ChannelPartnerLink[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.ChannelPartnerLink) => { + 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.listChannelPartnerLinks + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listChannelPartnerLinks, request) + ); + assert( + ( + client.descriptors.page.listChannelPartnerLinks + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listChannelPartnerLinksStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannelPartnerLinks.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listChannelPartnerLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.ChannelPartnerLink[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.ChannelPartnerLink) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listChannelPartnerLinks + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listChannelPartnerLinks, request) + ); + assert( + ( + client.descriptors.page.listChannelPartnerLinks + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannelPartnerLinks without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerLink() + ), + ]; + client.descriptors.page.listChannelPartnerLinks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IChannelPartnerLink[] = + []; + const iterable = client.listChannelPartnerLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listChannelPartnerLinks + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listChannelPartnerLinks + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannelPartnerLinks with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerLinksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerLinksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannelPartnerLinks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChannelPartnerLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IChannelPartnerLink[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listChannelPartnerLinks + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listChannelPartnerLinks + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCustomerRepricingConfigs', () => { + it('invokes listCustomerRepricingConfigs without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + ]; + client.innerApiCalls.listCustomerRepricingConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listCustomerRepricingConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCustomerRepricingConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomerRepricingConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomerRepricingConfigs without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + ]; + client.innerApiCalls.listCustomerRepricingConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCustomerRepricingConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.channel.v1.ICustomerRepricingConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCustomerRepricingConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomerRepricingConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomerRepricingConfigs with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomerRepricingConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listCustomerRepricingConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listCustomerRepricingConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomerRepricingConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCustomerRepricingConfigsStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + ]; + client.descriptors.page.listCustomerRepricingConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCustomerRepricingConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.CustomerRepricingConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.channel.v1.CustomerRepricingConfig + ) => { + 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.listCustomerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCustomerRepricingConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listCustomerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCustomerRepricingConfigsStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomerRepricingConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCustomerRepricingConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.CustomerRepricingConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.channel.v1.CustomerRepricingConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listCustomerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listCustomerRepricingConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listCustomerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomerRepricingConfigs without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.CustomerRepricingConfig() + ), + ]; + client.descriptors.page.listCustomerRepricingConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.ICustomerRepricingConfig[] = + []; + const iterable = client.listCustomerRepricingConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCustomerRepricingConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCustomerRepricingConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCustomerRepricingConfigs with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListCustomerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCustomerRepricingConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCustomerRepricingConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.ICustomerRepricingConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCustomerRepricingConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listCustomerRepricingConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listChannelPartnerRepricingConfigs', () => { + it('invokes listChannelPartnerRepricingConfigs without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + ]; + client.innerApiCalls.listChannelPartnerRepricingConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listChannelPartnerRepricingConfigs( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelPartnerRepricingConfigs without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + ]; + client.innerApiCalls.listChannelPartnerRepricingConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChannelPartnerRepricingConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelPartnerRepricingConfigs with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChannelPartnerRepricingConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listChannelPartnerRepricingConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChannelPartnerRepricingConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChannelPartnerRepricingConfigsStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + ]; + client.descriptors.page.listChannelPartnerRepricingConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listChannelPartnerRepricingConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig + ) => { + 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.listChannelPartnerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listChannelPartnerRepricingConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listChannelPartnerRepricingConfigsStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannelPartnerRepricingConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listChannelPartnerRepricingConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listChannelPartnerRepricingConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannelPartnerRepricingConfigs without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig() + ), + ]; + client.descriptors.page.listChannelPartnerRepricingConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig[] = + []; + const iterable = client.listChannelPartnerRepricingConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listChannelPartnerRepricingConfigs with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListChannelPartnerRepricingConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChannelPartnerRepricingConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listChannelPartnerRepricingConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listChannelPartnerRepricingConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProducts', () => { + it('invokes listProducts without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + ]; + client.innerApiCalls.listProducts = stubSimpleCall(expectedResponse); + const [response] = await client.listProducts(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listProducts without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + ]; + client.innerApiCalls.listProducts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProducts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IProduct[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listProducts with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listProducts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listProducts(request), expectedError); + }); + + it('invokes listProductsStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + ]; + client.descriptors.page.listProducts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listProductsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Product[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.Product) => { + 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.listProducts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProducts, request) + ); + }); + + it('invokes listProductsStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listProducts.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listProductsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Product[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.Product) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listProducts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProducts, request) + ); + }); + + it('uses async iteration with listProducts without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + generateSampleMessage(new protos.google.cloud.channel.v1.Product()), + ]; + client.descriptors.page.listProducts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IProduct[] = []; + const iterable = client.listProductsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listProducts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listProducts with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListProductsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listProducts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProductsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IProduct[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listProducts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('listSkus', () => { + it('invokes listSkus without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + ]; + client.innerApiCalls.listSkus = stubSimpleCall(expectedResponse); + const [response] = await client.listSkus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSkus without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + ]; + client.innerApiCalls.listSkus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSkus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.ISku[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSkus with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSkus = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSkus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSkusStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + ]; + client.descriptors.page.listSkus.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSkusStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Sku[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Sku) => { + 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.listSkus.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSkus, request) + ); + assert( + (client.descriptors.page.listSkus.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSkusStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSkus.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSkusStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Sku[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Sku) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSkus.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSkus, request) + ); + assert( + (client.descriptors.page.listSkus.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSkus without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + generateSampleMessage(new protos.google.cloud.channel.v1.Sku()), + ]; + client.descriptors.page.listSkus.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.ISku[] = []; + const iterable = client.listSkusAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSkus.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listSkus.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSkus with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSkusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSkus.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSkusAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.ISku[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSkus.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listSkus.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listOffers', () => { + it('invokes listOffers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + ]; + client.innerApiCalls.listOffers = stubSimpleCall(expectedResponse); + const [response] = await client.listOffers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOffers without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + ]; + client.innerApiCalls.listOffers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOffers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IOffer[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOffers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOffers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listOffers(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOffersStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + ]; + client.descriptors.page.listOffers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listOffersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Offer[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Offer) => { + 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.listOffers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listOffers, request) + ); + assert( + (client.descriptors.page.listOffers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOffersStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOffers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listOffersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.Offer[] = []; + stream.on('data', (response: protos.google.cloud.channel.v1.Offer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listOffers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listOffers, request) + ); + assert( + (client.descriptors.page.listOffers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOffers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + generateSampleMessage(new protos.google.cloud.channel.v1.Offer()), + ]; + client.descriptors.page.listOffers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IOffer[] = []; + const iterable = client.listOffersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listOffers.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listOffers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOffers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListOffersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOffers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listOffersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IOffer[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listOffers.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listOffers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPurchasableSkus', () => { + it('invokes listPurchasableSkus without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + ]; + client.innerApiCalls.listPurchasableSkus = + stubSimpleCall(expectedResponse); + const [response] = await client.listPurchasableSkus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPurchasableSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPurchasableSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPurchasableSkus without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + ]; + client.innerApiCalls.listPurchasableSkus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPurchasableSkus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IPurchasableSku[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPurchasableSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPurchasableSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPurchasableSkus with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPurchasableSkus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPurchasableSkus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPurchasableSkus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPurchasableSkus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPurchasableSkusStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + ]; + client.descriptors.page.listPurchasableSkus.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPurchasableSkusStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.PurchasableSku[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.PurchasableSku) => { + 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.listPurchasableSkus.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPurchasableSkus, request) + ); + assert( + (client.descriptors.page.listPurchasableSkus.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPurchasableSkusStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPurchasableSkus.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPurchasableSkusStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.PurchasableSku[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.PurchasableSku) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPurchasableSkus.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPurchasableSkus, request) + ); + assert( + (client.descriptors.page.listPurchasableSkus.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPurchasableSkus without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableSku() + ), + ]; + client.descriptors.page.listPurchasableSkus.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IPurchasableSku[] = []; + const iterable = client.listPurchasableSkusAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPurchasableSkus.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPurchasableSkus.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPurchasableSkus with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableSkusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableSkusRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPurchasableSkus.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPurchasableSkusAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IPurchasableSku[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPurchasableSkus.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPurchasableSkus.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPurchasableOffers', () => { + it('invokes listPurchasableOffers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + ]; + client.innerApiCalls.listPurchasableOffers = + stubSimpleCall(expectedResponse); + const [response] = await client.listPurchasableOffers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPurchasableOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPurchasableOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPurchasableOffers without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + ]; + client.innerApiCalls.listPurchasableOffers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPurchasableOffers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IPurchasableOffer[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPurchasableOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPurchasableOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPurchasableOffers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPurchasableOffers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPurchasableOffers(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listPurchasableOffers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPurchasableOffers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPurchasableOffersStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + ]; + client.descriptors.page.listPurchasableOffers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPurchasableOffersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.PurchasableOffer[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.PurchasableOffer) => { + 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.listPurchasableOffers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPurchasableOffers, request) + ); + assert( + ( + client.descriptors.page.listPurchasableOffers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPurchasableOffersStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPurchasableOffers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPurchasableOffersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.channel.v1.PurchasableOffer[] = []; + stream.on( + 'data', + (response: protos.google.cloud.channel.v1.PurchasableOffer) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listPurchasableOffers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPurchasableOffers, request) + ); + assert( + ( + client.descriptors.page.listPurchasableOffers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPurchasableOffers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + generateSampleMessage( + new protos.google.cloud.channel.v1.PurchasableOffer() + ), + ]; + client.descriptors.page.listPurchasableOffers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.channel.v1.IPurchasableOffer[] = []; + const iterable = client.listPurchasableOffersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPurchasableOffers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPurchasableOffers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPurchasableOffers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListPurchasableOffersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListPurchasableOffersRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPurchasableOffers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPurchasableOffersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.channel.v1.IPurchasableOffer[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPurchasableOffers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPurchasableOffers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSubscribers', () => { + it('invokes listSubscribers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listSubscribers = stubSimpleCall(expectedResponse); + const [response] = await client.listSubscribers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscribers without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listSubscribers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubscribers( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscribers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubscribers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSubscribers(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubscribers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubscribersStream without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listSubscribers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSubscribersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.listSubscribers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscribers, request) + ); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSubscribersStream with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscribers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSubscribersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubscribers, request) + ); + assert( + (client.descriptors.page.listSubscribers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubscribers without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listSubscribers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.listSubscribersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscribers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSubscribers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubscribers with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.ListSubscribersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.ListSubscribersRequest', + ['account'] + ); + request.account = defaultValue1; + const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubscribers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSubscribersAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSubscribers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSubscribers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('channelPartnerLink', () => { + const fakePath = '/rendered/path/channelPartnerLink'; + const expectedParameters = { + account: 'accountValue', + channel_partner_link: 'channelPartnerLinkValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.channelPartnerLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.channelPartnerLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('channelPartnerLinkPath', () => { + const result = client.channelPartnerLinkPath( + 'accountValue', + 'channelPartnerLinkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.channelPartnerLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromChannelPartnerLinkName', () => { + const result = client.matchAccountFromChannelPartnerLinkName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.channelPartnerLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelPartnerLinkFromChannelPartnerLinkName', () => { + const result = + client.matchChannelPartnerLinkFromChannelPartnerLinkName(fakePath); + assert.strictEqual(result, 'channelPartnerLinkValue'); + assert( + ( + client.pathTemplates.channelPartnerLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('channelPartnerRepricingConfig', () => { + const fakePath = '/rendered/path/channelPartnerRepricingConfig'; + const expectedParameters = { + account: 'accountValue', + channel_partner: 'channelPartnerValue', + channel_partner_repricing_config: 'channelPartnerRepricingConfigValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.channelPartnerRepricingConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.channelPartnerRepricingConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('channelPartnerRepricingConfigPath', () => { + const result = client.channelPartnerRepricingConfigPath( + 'accountValue', + 'channelPartnerValue', + 'channelPartnerRepricingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromChannelPartnerRepricingConfigName', () => { + const result = + client.matchAccountFromChannelPartnerRepricingConfigName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelPartnerFromChannelPartnerRepricingConfigName', () => { + const result = + client.matchChannelPartnerFromChannelPartnerRepricingConfigName( + fakePath + ); + assert.strictEqual(result, 'channelPartnerValue'); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchChannelPartnerRepricingConfigFromChannelPartnerRepricingConfigName', () => { + const result = + client.matchChannelPartnerRepricingConfigFromChannelPartnerRepricingConfigName( + fakePath + ); + assert.strictEqual(result, 'channelPartnerRepricingConfigValue'); + assert( + ( + client.pathTemplates.channelPartnerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customer', () => { + const fakePath = '/rendered/path/customer'; + const expectedParameters = { + account: 'accountValue', + customer: 'customerValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.customerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customerPath', () => { + const result = client.customerPath('accountValue', 'customerValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromCustomerName', () => { + const result = client.matchAccountFromCustomerName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.customerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerFromCustomerName', () => { + const result = client.matchCustomerFromCustomerName(fakePath); + assert.strictEqual(result, 'customerValue'); + assert( + (client.pathTemplates.customerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customerRepricingConfig', () => { + const fakePath = '/rendered/path/customerRepricingConfig'; + const expectedParameters = { + account: 'accountValue', + customer: 'customerValue', + customer_repricing_config: 'customerRepricingConfigValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.customerRepricingConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customerRepricingConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customerRepricingConfigPath', () => { + const result = client.customerRepricingConfigPath( + 'accountValue', + 'customerValue', + 'customerRepricingConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromCustomerRepricingConfigName', () => { + const result = + client.matchAccountFromCustomerRepricingConfigName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerFromCustomerRepricingConfigName', () => { + const result = + client.matchCustomerFromCustomerRepricingConfigName(fakePath); + assert.strictEqual(result, 'customerValue'); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerRepricingConfigFromCustomerRepricingConfigName', () => { + const result = + client.matchCustomerRepricingConfigFromCustomerRepricingConfigName( + fakePath + ); + assert.strictEqual(result, 'customerRepricingConfigValue'); + assert( + ( + client.pathTemplates.customerRepricingConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entitlement', () => { + const fakePath = '/rendered/path/entitlement'; + const expectedParameters = { + account: 'accountValue', + customer: 'customerValue', + entitlement: 'entitlementValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entitlementPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entitlementPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entitlementPath', () => { + const result = client.entitlementPath( + 'accountValue', + 'customerValue', + 'entitlementValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entitlementPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromEntitlementName', () => { + const result = client.matchAccountFromEntitlementName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.entitlementPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomerFromEntitlementName', () => { + const result = client.matchCustomerFromEntitlementName(fakePath); + assert.strictEqual(result, 'customerValue'); + assert( + (client.pathTemplates.entitlementPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntitlementFromEntitlementName', () => { + const result = client.matchEntitlementFromEntitlementName(fakePath); + assert.strictEqual(result, 'entitlementValue'); + assert( + (client.pathTemplates.entitlementPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('offer', () => { + const fakePath = '/rendered/path/offer'; + const expectedParameters = { + account: 'accountValue', + offer: 'offerValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.offerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.offerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('offerPath', () => { + const result = client.offerPath('accountValue', 'offerValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.offerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromOfferName', () => { + const result = client.matchAccountFromOfferName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.offerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchOfferFromOfferName', () => { + const result = client.matchOfferFromOfferName(fakePath); + assert.strictEqual(result, 'offerValue'); + assert( + (client.pathTemplates.offerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('product', () => { + const fakePath = '/rendered/path/product'; + const expectedParameters = { + product: 'productValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.productPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.productPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('productPath', () => { + const result = client.productPath('productValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.productPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProductFromProductName', () => { + const result = client.matchProductFromProductName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.productPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('report', () => { + const fakePath = '/rendered/path/report'; + const expectedParameters = { + account: 'accountValue', + report: 'reportValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reportPath', () => { + const result = client.reportPath('accountValue', 'reportValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reportPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromReportName', () => { + const result = client.matchAccountFromReportName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.reportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReportFromReportName', () => { + const result = client.matchReportFromReportName(fakePath); + assert.strictEqual(result, 'reportValue'); + assert( + (client.pathTemplates.reportPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reportJob', () => { + const fakePath = '/rendered/path/reportJob'; + const expectedParameters = { + account: 'accountValue', + report_job: 'reportJobValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reportJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reportJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reportJobPath', () => { + const result = client.reportJobPath('accountValue', 'reportJobValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reportJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromReportJobName', () => { + const result = client.matchAccountFromReportJobName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.reportJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReportJobFromReportJobName', () => { + const result = client.matchReportJobFromReportJobName(fakePath); + assert.strictEqual(result, 'reportJobValue'); + assert( + (client.pathTemplates.reportJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('sku', () => { + const fakePath = '/rendered/path/sku'; + const expectedParameters = { + product: 'productValue', + sku: 'skuValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.skuPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.skuPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('skuPath', () => { + const result = client.skuPath('productValue', 'skuValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.skuPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProductFromSkuName', () => { + const result = client.matchProductFromSkuName(fakePath); + assert.strictEqual(result, 'productValue'); + assert( + (client.pathTemplates.skuPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSkuFromSkuName', () => { + const result = client.matchSkuFromSkuName(fakePath); + assert.strictEqual(result, 'skuValue'); + assert( + (client.pathTemplates.skuPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-channel/tsconfig.json b/packages/google-cloud-channel/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-channel/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-channel/webpack.config.js b/packages/google-cloud-channel/webpack.config.js new file mode 100644 index 00000000000..cac423509ef --- /dev/null +++ b/packages/google-cloud-channel/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'CloudChannelReportsService', + filename: './cloud-channel-reports-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index ca8fb90627b..a7fdc27cdc3 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -14,6 +14,7 @@ "packages/google-cloud-bigquery-datatransfer": {}, "packages/google-cloud-bigquery-reservation": {}, "packages/google-cloud-certificatemanager": {}, + "packages/google-cloud-channel": {}, "packages/google-cloud-contentwarehouse": {}, "packages/google-cloud-dataplex": {}, "packages/google-cloud-dataproc": {},