From d2eb14a505027ed397adf95cb529ef750ed77d00 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 9 Dec 2022 18:05:25 +0000 Subject: [PATCH 1/3] feat: Add support for granular repricing configurations via SkuGroups in Cloud Channel Repricing APIs PiperOrigin-RevId: 494176375 Source-Link: https://github.com/googleapis/googleapis/commit/e69c47f438eb55caec51716fbc2b8a42313ca024 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0f2614611f32e225fbad538a39be4fbf9c52a7a4 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNoYW5uZWwvLk93bEJvdC55YW1sIiwiaCI6IjBmMjYxNDYxMWYzMmUyMjVmYmFkNTM4YTM5YmU0ZmJmOWM1MmE3YTQifQ== --- .../google-cloud-channel/v1/.eslintignore | 7 + .../google-cloud-channel/v1/.eslintrc.json | 3 + .../google-cloud-channel/v1/.gitignore | 14 + .../google-cloud-channel/v1/.jsdoc.js | 55 + .../google-cloud-channel/v1/.mocharc.js | 33 + .../google-cloud-channel/v1/.prettierrc.js | 22 + .../google-cloud-channel/v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../google-cloud-channel/v1/package.json | 65 + .../channel/v1/channel_partner_links.proto | 102 + .../google/cloud/channel/v1/common.proto | 152 + .../google/cloud/channel/v1/customers.proto | 114 + .../cloud/channel/v1/entitlements.proto | 262 + .../google/cloud/channel/v1/offers.proto | 330 + .../google/cloud/channel/v1/operations.proto | 68 + .../google/cloud/channel/v1/products.proto | 94 + .../cloud/channel/v1/reports_service.proto | 444 + .../google/cloud/channel/v1/repricing.proto | 194 + .../google/cloud/channel/v1/service.proto | 2635 ++++++ .../cloud/channel/v1/subscriber_event.proto | 119 + ...el_reports_service.fetch_report_results.js | 83 + ...ud_channel_reports_service.list_reports.js | 86 + ..._channel_reports_service.run_report_job.js | 88 + ...ud_channel_service.activate_entitlement.js | 77 + ...loud_channel_service.cancel_entitlement.js | 77 + .../v1/cloud_channel_service.change_offer.js | 94 + ...cloud_channel_service.change_parameters.js | 90 + ...channel_service.change_renewal_settings.js | 82 + ...ice.check_cloud_identity_accounts_exist.js | 67 + ...nel_service.create_channel_partner_link.js | 70 + ...create_channel_partner_repricing_config.js | 68 + .../cloud_channel_service.create_customer.js | 67 + ...ervice.create_customer_repricing_config.js | 68 + ...loud_channel_service.create_entitlement.js | 82 + ...delete_channel_partner_repricing_config.js | 62 + .../cloud_channel_service.delete_customer.js | 61 + ...ervice.delete_customer_repricing_config.js | 63 + ...hannel_service.get_channel_partner_link.js | 67 + ...ce.get_channel_partner_repricing_config.js | 63 + .../v1/cloud_channel_service.get_customer.js | 62 + ...l_service.get_customer_repricing_config.js | 63 + .../cloud_channel_service.get_entitlement.js | 63 + .../cloud_channel_service.import_customer.js | 100 + ...nnel_service.list_channel_partner_links.js | 83 + ....list_channel_partner_repricing_configs.js | 94 + ...service.list_customer_repricing_configs.js | 90 + .../cloud_channel_service.list_customers.js | 86 + ...cloud_channel_service.list_entitlements.js | 80 + .../v1/cloud_channel_service.list_offers.js | 88 + .../v1/cloud_channel_service.list_products.js | 80 + ...channel_service.list_purchasable_offers.js | 88 + ...d_channel_service.list_purchasable_skus.js | 88 + .../v1/cloud_channel_service.list_skus.js | 88 + .../cloud_channel_service.list_subscribers.js | 77 + ...hannel_service.list_transferable_offers.js | 98 + ..._channel_service.list_transferable_skus.js | 105 + .../v1/cloud_channel_service.lookup_offer.js | 63 + ...hannel_service.provision_cloud_identity.js | 75 + ...oud_channel_service.register_subscriber.js | 67 + ...loud_channel_service.start_paid_service.js | 77 + ...oud_channel_service.suspend_entitlement.js | 77 + ...d_channel_service.transfer_entitlements.js | 89 + ...service.transfer_entitlements_to_google.js | 82 + ...d_channel_service.unregister_subscriber.js | 67 + ...nel_service.update_channel_partner_link.js | 76 + ...update_channel_partner_repricing_config.js | 61 + .../cloud_channel_service.update_customer.js | 66 + ...ervice.update_customer_repricing_config.js | 61 + ...ppet_metadata.google.cloud.channel.v1.json | 2323 +++++ .../google-cloud-channel/v1/src/index.ts | 27 + .../cloud_channel_reports_service_client.ts | 1515 ++++ ...channel_reports_service_client_config.json | 38 + ...ud_channel_reports_service_proto_list.json | 13 + .../v1/src/v1/cloud_channel_service_client.ts | 7419 +++++++++++++++ .../cloud_channel_service_client_config.json | 263 + .../v1/cloud_channel_service_proto_list.json | 13 + .../v1/src/v1/gapic_metadata.json | 577 ++ .../google-cloud-channel/v1/src/v1/index.ts | 20 + .../system-test/fixtures/sample/src/index.js | 28 + .../system-test/fixtures/sample/src/index.ts | 38 + .../v1/system-test/install.ts | 49 + .../gapic_cloud_channel_reports_service_v1.ts | 1511 ++++ .../v1/test/gapic_cloud_channel_service_v1.ts | 7940 +++++++++++++++++ .../google-cloud-channel/v1/tsconfig.json | 19 + .../google-cloud-channel/v1/webpack.config.js | 64 + 85 files changed, 30296 insertions(+) create mode 100644 owl-bot-staging/google-cloud-channel/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-channel/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-channel/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/README.md create mode 100644 owl-bot-staging/google-cloud-channel/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/package.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-channel/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-channel/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-channel/v1/.eslintignore b/owl-bot-staging/google-cloud-channel/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json b/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-channel/v1/.gitignore b/owl-bot-staging/google-cloud-channel/v1/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/.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/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js b/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js new file mode 100644 index 00000000000..40f6e639a6f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/.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/owl-bot-staging/google-cloud-channel/v1/.mocharc.js b/owl-bot-staging/google-cloud-channel/v1/.mocharc.js new file mode 100644 index 00000000000..481c522b00f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/.mocharc.js @@ -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 gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js b/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js new file mode 100644 index 00000000000..494e147865d --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-channel/v1/README.md b/owl-bot-staging/google-cloud-channel/v1/README.md new file mode 100644 index 00000000000..a83379c9f3a --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/README.md @@ -0,0 +1 @@ +Channel: Nodejs Client diff --git a/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json b/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/package.json b/owl-bot-staging/google-cloud-channel/v1/package.json new file mode 100644 index 00000000000..aacd717e88b --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/package.json @@ -0,0 +1,65 @@ +{ + "name": "@google-cloud/channel", + "version": "0.1.0", + "description": "Channel client for Node.js", + "repository": "googleapis/nodejs-channel", + "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 reports service", + "cloud channel service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "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": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.62", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.0.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.8.3", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto new file mode 100644 index 00000000000..d0607af278c --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto @@ -0,0 +1,102 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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]; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto new file mode 100644 index 00000000000..2380722ac8d --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto new file mode 100644 index 00000000000..18bf1ad99a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto @@ -0,0 +1,114 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto new file mode 100644 index 00000000000..8a6633b140c --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto @@ -0,0 +1,262 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto new file mode 100644 index 00000000000..3a504045350 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto @@ -0,0 +1,330 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto new file mode 100644 index 00000000000..e9e190772cb --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto @@ -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 +// +// 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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto new file mode 100644 index 00000000000..411e1698b96 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto new file mode 100644 index 00000000000..1cb87124cb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto @@ -0,0 +1,444 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto new file mode 100644 index 00000000000..1a15067b378 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto @@ -0,0 +1,194 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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]; + + // The conditional overrides to apply for this configuration. If you list + // multiple overrides, only the first valid override is used. If you don't + // list any overrides, the API uses the normal adjustment and rebilling basis. + repeated ConditionalOverride conditional_overrides = 6; +} + +// 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; +} + +// Specifies the override to conditionally apply. +message ConditionalOverride { + // Required. Information about the applied override's adjustment. + RepricingAdjustment adjustment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to + // use for the applied override. Shows the relative cost based on your + // repricing costs. + RebillingBasis rebilling_basis = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the condition which, if met, will apply the override. + RepricingCondition repricing_condition = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the various repricing conditions you can use for a conditional +// override. +message RepricingCondition { + // Represents the types of existing conditional statements. + oneof condition { + // SKU Group condition for override. + SkuGroupCondition sku_group_condition = 1; + } +} + +// A condition that applies the override if a line item SKU is found in the SKU +// group. +message SkuGroupCondition { + // Specifies a SKU group (https://cloud.google.com/skus/sku-groups). + // Resource name of SKU group. Format: + // accounts/{account}/skuGroups/{sku_group}. + // Example: + // "accounts/C01234/skuGroups/3d50fd57-3157-4577-a5a9-a219b8490041". + string sku_group = 1; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto new file mode 100644 index 00000000000..93730e9ea33 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto @@ -0,0 +1,2635 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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; +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto new file mode 100644 index 00000000000..0135c066f44 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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; + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js new file mode 100644 index 00000000000..38703fe5671 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js new file mode 100644 index 00000000000..56b561b5f62 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js new file mode 100644 index 00000000000..6f1866707ea --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js new file mode 100644 index 00000000000..18b3c57f4af --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js new file mode 100644 index 00000000000..4f89a80116b --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js new file mode 100644 index 00000000000..2442ce2baad --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js @@ -0,0 +1,94 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js new file mode 100644 index 00000000000..b4ac8bb935f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js new file mode 100644 index 00000000000..a4f56944cbc --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js new file mode 100644 index 00000000000..c519611c960 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js new file mode 100644 index 00000000000..29afadcf520 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js new file mode 100644 index 00000000000..ebddea882f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js new file mode 100644 index 00000000000..869f222ba01 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js new file mode 100644 index 00000000000..826bdced548 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_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, 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js new file mode 100644 index 00000000000..b8659127c46 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.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, 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js new file mode 100644 index 00000000000..6cc8d7d7392 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js new file mode 100644 index 00000000000..b4c54c9a8b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js new file mode 100644 index 00000000000..3722b11cbe5 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js new file mode 100644 index 00000000000..dc136c38aa5 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js new file mode 100644 index 00000000000..77803006a9d --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js new file mode 100644 index 00000000000..7c9be5abcbe --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js new file mode 100644 index 00000000000..dff81702966 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js new file mode 100644 index 00000000000..b9ed504c2c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js new file mode 100644 index 00000000000..790f8400f92 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js @@ -0,0 +1,100 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js new file mode 100644 index 00000000000..f15c6488eff --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.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_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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js new file mode 100644 index 00000000000..67ae5544814 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js @@ -0,0 +1,94 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js new file mode 100644 index 00000000000..147c7372d0c --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js @@ -0,0 +1,90 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js new file mode 100644 index 00000000000..c31b53e38ae --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js new file mode 100644 index 00000000000..3f8141a1ab0 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js @@ -0,0 +1,80 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js new file mode 100644 index 00000000000..2d5aa523628 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js new file mode 100644 index 00000000000..d48a6ed20ec --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js new file mode 100644 index 00000000000..ce69e278509 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js new file mode 100644 index 00000000000..bb6bb21c485 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js new file mode 100644 index 00000000000..f7c1a1984f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js new file mode 100644 index 00000000000..42416cf9bde --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js new file mode 100644 index 00000000000..c4f6fb76c93 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js @@ -0,0 +1,98 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js new file mode 100644 index 00000000000..5aa3ba3c98a --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js @@ -0,0 +1,105 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js new file mode 100644 index 00000000000..43c97a05551 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js new file mode 100644 index 00000000000..81b8b0a0ad2 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js new file mode 100644 index 00000000000..027099cf1b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js new file mode 100644 index 00000000000..d6989b2956f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js new file mode 100644 index 00000000000..f908473d2ee --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js new file mode 100644 index 00000000000..f898044ffca --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js @@ -0,0 +1,89 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js new file mode 100644 index 00000000000..f28efb36e02 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.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, 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js new file mode 100644 index 00000000000..2055f05d52c --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.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(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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js new file mode 100644 index 00000000000..e28cd686492 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js new file mode 100644 index 00000000000..6dfb5c06606 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js new file mode 100644 index 00000000000..fb7ed485b06 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js new file mode 100644 index 00000000000..becdd61604c --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json new file mode 100644 index 00000000000..75499244799 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json @@ -0,0 +1,2323 @@ +{ + "clientLibrary": { + "name": "nodejs-channel", + "version": "0.1.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": 75, + "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": 78, + "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": 78, + "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": 92, + "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": 72, + "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": 97, + "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": 90, + "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": 74, + "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": 82, + "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": 74, + "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": 86, + "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": 69, + "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": 69, + "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": 69, + "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": 69, + "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": 81, + "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": 74, + "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": 75, + "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": 82, + "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": 60, + "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": 86, + "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": 54, + "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": 59, + "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": 59, + "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" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-channel/v1/src/index.ts b/owl-bot-staging/google-cloud-channel/v1/src/index.ts new file mode 100644 index 00000000000..40ff077679f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts new file mode 100644 index 00000000000..10534d8a429 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts @@ -0,0 +1,1515 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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.longrunning.IOperation|undefined, {}|undefined + ]>; + runReportJob( + request: protos.google.cloud.channel.v1.IRunReportJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runReportJob( + request: protos.google.cloud.channel.v1.IRunReportJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + runReportJob( + request?: protos.google.cloud.channel.v1.IRunReportJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } + /** + * 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json new file mode 100644 index 00000000000..c3db1fd9619 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json new file mode 100644 index 00000000000..aff1dcc4ca3 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts new file mode 100644 index 00000000000..56becdcf56f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts @@ -0,0 +1,7419 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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.longrunning.IOperation|undefined, {}|undefined + ]>; + provisionCloudIdentity( + request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + provisionCloudIdentity( + request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + provisionCloudIdentity( + request?: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + createEntitlement( + request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEntitlement( + request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEntitlement( + request?: protos.google.cloud.channel.v1.ICreateEntitlementRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + changeParameters( + request: protos.google.cloud.channel.v1.IChangeParametersRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + changeParameters( + request: protos.google.cloud.channel.v1.IChangeParametersRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + changeParameters( + request?: protos.google.cloud.channel.v1.IChangeParametersRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + changeRenewalSettings( + request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + changeRenewalSettings( + request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + changeRenewalSettings( + request?: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + changeOffer( + request: protos.google.cloud.channel.v1.IChangeOfferRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + changeOffer( + request: protos.google.cloud.channel.v1.IChangeOfferRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + changeOffer( + request?: protos.google.cloud.channel.v1.IChangeOfferRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + startPaidService( + request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startPaidService( + request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startPaidService( + request?: protos.google.cloud.channel.v1.IStartPaidServiceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + suspendEntitlement( + request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + suspendEntitlement( + request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + suspendEntitlement( + request?: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + cancelEntitlement( + request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelEntitlement( + request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelEntitlement( + request?: protos.google.cloud.channel.v1.ICancelEntitlementRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + activateEntitlement( + request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + activateEntitlement( + request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + activateEntitlement( + request?: protos.google.cloud.channel.v1.IActivateEntitlementRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + '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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + transferEntitlements( + request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + transferEntitlements( + request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + transferEntitlements( + request?: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.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>{ + 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; + } +/** + * 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.longrunning.IOperation|undefined, {}|undefined + ]>; + transferEntitlementsToGoogle( + request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + transferEntitlementsToGoogle( + request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + transferEntitlementsToGoogle( + request?: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.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>{ + 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; + } + /** + * 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json new file mode 100644 index 00000000000..625117c33e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json new file mode 100644 index 00000000000..aff1dcc4ca3 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..ae5f1241294 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts new file mode 100644 index 00000000000..503f298a0d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..00977d9b464 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..730a061ac94 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts b/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts new file mode 100644 index 00000000000..557a57558e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts new file mode 100644 index 00000000000..1dfadbbe14f --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts @@ -0,0 +1,1511 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts new file mode 100644 index 00000000000..f7d4a0ccdec --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts @@ -0,0 +1,7940 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + 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/owl-bot-staging/google-cloud-channel/v1/tsconfig.json b/owl-bot-staging/google-cloud-channel/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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/owl-bot-staging/google-cloud-channel/v1/webpack.config.js b/owl-bot-staging/google-cloud-channel/v1/webpack.config.js new file mode 100644 index 00000000000..8d1a69f3594 --- /dev/null +++ b/owl-bot-staging/google-cloud-channel/v1/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', +}; From 34b46d9683d46037c42c971937ed3e20b3a41934 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 9 Dec 2022 18:12:00 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-channel/v1/.eslintignore | 7 - .../google-cloud-channel/v1/.eslintrc.json | 3 - .../google-cloud-channel/v1/.gitignore | 14 - .../google-cloud-channel/v1/.jsdoc.js | 55 - .../google-cloud-channel/v1/.mocharc.js | 33 - .../google-cloud-channel/v1/.prettierrc.js | 22 - .../google-cloud-channel/v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../google-cloud-channel/v1/package.json | 65 - .../channel/v1/channel_partner_links.proto | 102 - .../google/cloud/channel/v1/common.proto | 152 - .../google/cloud/channel/v1/customers.proto | 114 - .../cloud/channel/v1/entitlements.proto | 262 - .../google/cloud/channel/v1/offers.proto | 330 - .../google/cloud/channel/v1/operations.proto | 68 - .../google/cloud/channel/v1/products.proto | 94 - .../cloud/channel/v1/reports_service.proto | 444 - .../google/cloud/channel/v1/repricing.proto | 194 - .../google/cloud/channel/v1/service.proto | 2635 ------ .../cloud/channel/v1/subscriber_event.proto | 119 - ...el_reports_service.fetch_report_results.js | 83 - ...ud_channel_reports_service.list_reports.js | 86 - ..._channel_reports_service.run_report_job.js | 88 - ...ud_channel_service.activate_entitlement.js | 77 - ...loud_channel_service.cancel_entitlement.js | 77 - .../v1/cloud_channel_service.change_offer.js | 94 - ...cloud_channel_service.change_parameters.js | 90 - ...channel_service.change_renewal_settings.js | 82 - ...ice.check_cloud_identity_accounts_exist.js | 67 - ...nel_service.create_channel_partner_link.js | 70 - ...create_channel_partner_repricing_config.js | 68 - .../cloud_channel_service.create_customer.js | 67 - ...ervice.create_customer_repricing_config.js | 68 - ...loud_channel_service.create_entitlement.js | 82 - ...delete_channel_partner_repricing_config.js | 62 - .../cloud_channel_service.delete_customer.js | 61 - ...ervice.delete_customer_repricing_config.js | 63 - ...hannel_service.get_channel_partner_link.js | 67 - ...ce.get_channel_partner_repricing_config.js | 63 - .../v1/cloud_channel_service.get_customer.js | 62 - ...l_service.get_customer_repricing_config.js | 63 - .../cloud_channel_service.get_entitlement.js | 63 - .../cloud_channel_service.import_customer.js | 100 - ...nnel_service.list_channel_partner_links.js | 83 - ....list_channel_partner_repricing_configs.js | 94 - ...service.list_customer_repricing_configs.js | 90 - .../cloud_channel_service.list_customers.js | 86 - ...cloud_channel_service.list_entitlements.js | 80 - .../v1/cloud_channel_service.list_offers.js | 88 - .../v1/cloud_channel_service.list_products.js | 80 - ...channel_service.list_purchasable_offers.js | 88 - ...d_channel_service.list_purchasable_skus.js | 88 - .../v1/cloud_channel_service.list_skus.js | 88 - .../cloud_channel_service.list_subscribers.js | 77 - ...hannel_service.list_transferable_offers.js | 98 - ..._channel_service.list_transferable_skus.js | 105 - .../v1/cloud_channel_service.lookup_offer.js | 63 - ...hannel_service.provision_cloud_identity.js | 75 - ...oud_channel_service.register_subscriber.js | 67 - ...loud_channel_service.start_paid_service.js | 77 - ...oud_channel_service.suspend_entitlement.js | 77 - ...d_channel_service.transfer_entitlements.js | 89 - ...service.transfer_entitlements_to_google.js | 82 - ...d_channel_service.unregister_subscriber.js | 67 - ...nel_service.update_channel_partner_link.js | 76 - ...update_channel_partner_repricing_config.js | 61 - .../cloud_channel_service.update_customer.js | 66 - ...ervice.update_customer_repricing_config.js | 61 - ...ppet_metadata.google.cloud.channel.v1.json | 2323 ----- .../google-cloud-channel/v1/src/index.ts | 27 - .../cloud_channel_reports_service_client.ts | 1515 ---- ...channel_reports_service_client_config.json | 38 - ...ud_channel_reports_service_proto_list.json | 13 - .../v1/src/v1/cloud_channel_service_client.ts | 7419 --------------- .../cloud_channel_service_client_config.json | 263 - .../v1/cloud_channel_service_proto_list.json | 13 - .../v1/src/v1/gapic_metadata.json | 577 -- .../google-cloud-channel/v1/src/v1/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - .../v1/system-test/install.ts | 49 - .../gapic_cloud_channel_reports_service_v1.ts | 1511 ---- .../v1/test/gapic_cloud_channel_service_v1.ts | 7940 ----------------- .../google-cloud-channel/v1/tsconfig.json | 19 - .../google-cloud-channel/v1/webpack.config.js | 64 - .../channel/v1/channel_partner_links.proto | 25 +- .../google/cloud/channel/v1/common.proto | 2 +- .../google/cloud/channel/v1/customers.proto | 14 +- .../cloud/channel/v1/entitlements.proto | 68 +- .../google/cloud/channel/v1/offers.proto | 9 +- .../google/cloud/channel/v1/operations.proto | 5 +- .../google/cloud/channel/v1/products.proto | 2 +- .../cloud/channel/v1/reports_service.proto | 97 +- .../google/cloud/channel/v1/repricing.proto | 89 +- .../google/cloud/channel/v1/service.proto | 795 +- .../cloud/channel/v1/subscriber_event.proto | 10 +- .../google-cloud-channel/protos/protos.d.ts | 312 + .../google-cloud-channel/protos/protos.js | 759 ++ .../google-cloud-channel/protos/protos.json | 53 + ...el_reports_service.fetch_report_results.js | 15 +- ...ud_channel_reports_service.list_reports.js | 17 +- ..._channel_reports_service.run_report_job.js | 8 +- ...ud_channel_service.activate_entitlement.js | 5 +- ...loud_channel_service.cancel_entitlement.js | 5 +- .../v1/cloud_channel_service.change_offer.js | 11 +- ...cloud_channel_service.change_parameters.js | 11 +- ...channel_service.change_renewal_settings.js | 5 +- ...create_channel_partner_repricing_config.js | 4 +- .../cloud_channel_service.create_customer.js | 4 +- ...ervice.create_customer_repricing_config.js | 5 +- ...loud_channel_service.create_entitlement.js | 11 +- ...delete_channel_partner_repricing_config.js | 3 +- ...ervice.delete_customer_repricing_config.js | 4 +- .../cloud_channel_service.import_customer.js | 7 +- ...nnel_service.list_channel_partner_links.js | 17 +- ....list_channel_partner_repricing_configs.js | 25 +- ...service.list_customer_repricing_configs.js | 12 +- .../cloud_channel_service.list_customers.js | 13 +- ...cloud_channel_service.list_entitlements.js | 12 +- .../v1/cloud_channel_service.list_offers.js | 10 +- .../v1/cloud_channel_service.list_products.js | 6 +- ...channel_service.list_purchasable_offers.js | 6 +- ...d_channel_service.list_purchasable_skus.js | 6 +- .../v1/cloud_channel_service.list_skus.js | 6 +- .../cloud_channel_service.list_subscribers.js | 8 +- ...hannel_service.list_transferable_offers.js | 6 +- ..._channel_service.list_transferable_skus.js | 7 +- ...oud_channel_service.register_subscriber.js | 3 +- ...loud_channel_service.start_paid_service.js | 5 +- ...oud_channel_service.suspend_entitlement.js | 5 +- ...d_channel_service.transfer_entitlements.js | 11 +- ...service.transfer_entitlements_to_google.js | 11 +- ...d_channel_service.unregister_subscriber.js | 3 +- ...nel_service.update_channel_partner_link.js | 4 +- ...ppet_metadata.google.cloud.channel.v1.json | 48 +- .../cloud_channel_reports_service_client.ts | 113 +- .../src/v1/cloud_channel_service_client.ts | 779 +- 137 files changed, 2519 insertions(+), 31248 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-channel/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-channel/v1/.eslintignore b/owl-bot-staging/google-cloud-channel/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json b/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-channel/v1/.gitignore b/owl-bot-staging/google-cloud-channel/v1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.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/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js b/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js deleted file mode 100644 index 40f6e639a6f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/.mocharc.js b/owl-bot-staging/google-cloud-channel/v1/.mocharc.js deleted file mode 100644 index 481c522b00f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js b/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js deleted file mode 100644 index 494e147865d..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-channel/v1/README.md b/owl-bot-staging/google-cloud-channel/v1/README.md deleted file mode 100644 index a83379c9f3a..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Channel: Nodejs Client diff --git a/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json b/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/package.json b/owl-bot-staging/google-cloud-channel/v1/package.json deleted file mode 100644 index aacd717e88b..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@google-cloud/channel", - "version": "0.1.0", - "description": "Channel client for Node.js", - "repository": "googleapis/nodejs-channel", - "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 reports service", - "cloud channel service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "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": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.2" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.62", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto deleted file mode 100644 index d0607af278c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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]; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto deleted file mode 100644 index 2380722ac8d..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto deleted file mode 100644 index 18bf1ad99a1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto deleted file mode 100644 index 8a6633b140c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto deleted file mode 100644 index 3a504045350..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto deleted file mode 100644 index e9e190772cb..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto deleted file mode 100644 index 411e1698b96..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto deleted file mode 100644 index 1cb87124cb6..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto deleted file mode 100644 index 1a15067b378..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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]; - - // The conditional overrides to apply for this configuration. If you list - // multiple overrides, only the first valid override is used. If you don't - // list any overrides, the API uses the normal adjustment and rebilling basis. - repeated ConditionalOverride conditional_overrides = 6; -} - -// 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; -} - -// Specifies the override to conditionally apply. -message ConditionalOverride { - // Required. Information about the applied override's adjustment. - RepricingAdjustment adjustment = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to - // use for the applied override. Shows the relative cost based on your - // repricing costs. - RebillingBasis rebilling_basis = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specifies the condition which, if met, will apply the override. - RepricingCondition repricing_condition = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Represents the various repricing conditions you can use for a conditional -// override. -message RepricingCondition { - // Represents the types of existing conditional statements. - oneof condition { - // SKU Group condition for override. - SkuGroupCondition sku_group_condition = 1; - } -} - -// A condition that applies the override if a line item SKU is found in the SKU -// group. -message SkuGroupCondition { - // Specifies a SKU group (https://cloud.google.com/skus/sku-groups). - // Resource name of SKU group. Format: - // accounts/{account}/skuGroups/{sku_group}. - // Example: - // "accounts/C01234/skuGroups/3d50fd57-3157-4577-a5a9-a219b8490041". - string sku_group = 1; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto deleted file mode 100644 index 93730e9ea33..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto +++ /dev/null @@ -1,2635 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto deleted file mode 100644 index 0135c066f44..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js deleted file mode 100644 index 38703fe5671..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js deleted file mode 100644 index 56b561b5f62..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js deleted file mode 100644 index 6f1866707ea..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js deleted file mode 100644 index 18b3c57f4af..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js deleted file mode 100644 index 4f89a80116b..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js deleted file mode 100644 index 2442ce2baad..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js deleted file mode 100644 index b4ac8bb935f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js deleted file mode 100644 index a4f56944cbc..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js deleted file mode 100644 index c519611c960..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js deleted file mode 100644 index 29afadcf520..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js deleted file mode 100644 index ebddea882f0..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js deleted file mode 100644 index 869f222ba01..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js deleted file mode 100644 index 826bdced548..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js deleted file mode 100644 index b8659127c46..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js deleted file mode 100644 index 6cc8d7d7392..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js deleted file mode 100644 index b4c54c9a8b7..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js deleted file mode 100644 index 3722b11cbe5..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js deleted file mode 100644 index dc136c38aa5..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js deleted file mode 100644 index 77803006a9d..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js deleted file mode 100644 index 7c9be5abcbe..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js deleted file mode 100644 index dff81702966..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js deleted file mode 100644 index b9ed504c2c6..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js deleted file mode 100644 index 790f8400f92..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js deleted file mode 100644 index f15c6488eff..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js deleted file mode 100644 index 67ae5544814..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js deleted file mode 100644 index 147c7372d0c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js deleted file mode 100644 index c31b53e38ae..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js deleted file mode 100644 index 3f8141a1ab0..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js deleted file mode 100644 index 2d5aa523628..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js deleted file mode 100644 index d48a6ed20ec..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js deleted file mode 100644 index ce69e278509..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js deleted file mode 100644 index bb6bb21c485..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js deleted file mode 100644 index f7c1a1984f1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js deleted file mode 100644 index 42416cf9bde..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js deleted file mode 100644 index c4f6fb76c93..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js deleted file mode 100644 index 5aa3ba3c98a..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js deleted file mode 100644 index 43c97a05551..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js deleted file mode 100644 index 81b8b0a0ad2..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js deleted file mode 100644 index 027099cf1b5..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js deleted file mode 100644 index d6989b2956f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js deleted file mode 100644 index f908473d2ee..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js deleted file mode 100644 index f898044ffca..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js deleted file mode 100644 index f28efb36e02..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js deleted file mode 100644 index 2055f05d52c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js deleted file mode 100644 index e28cd686492..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js deleted file mode 100644 index 6dfb5c06606..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js deleted file mode 100644 index fb7ed485b06..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js deleted file mode 100644 index becdd61604c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json deleted file mode 100644 index 75499244799..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json +++ /dev/null @@ -1,2323 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-channel", - "version": "0.1.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": 75, - "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": 78, - "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": 78, - "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": 92, - "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": 72, - "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": 97, - "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": 90, - "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": 74, - "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": 82, - "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": 74, - "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": 86, - "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": 69, - "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": 69, - "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": 69, - "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": 69, - "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": 81, - "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": 74, - "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": 75, - "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": 82, - "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": 60, - "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": 86, - "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": 54, - "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": 59, - "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": 59, - "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" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-channel/v1/src/index.ts b/owl-bot-staging/google-cloud-channel/v1/src/index.ts deleted file mode 100644 index 40ff077679f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts deleted file mode 100644 index 10534d8a429..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts +++ /dev/null @@ -1,1515 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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.longrunning.IOperation|undefined, {}|undefined - ]>; - runReportJob( - request: protos.google.cloud.channel.v1.IRunReportJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runReportJob( - request: protos.google.cloud.channel.v1.IRunReportJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runReportJob( - request?: protos.google.cloud.channel.v1.IRunReportJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } - /** - * 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json deleted file mode 100644 index c3db1fd9619..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json deleted file mode 100644 index aff1dcc4ca3..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "../../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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts deleted file mode 100644 index 56becdcf56f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts +++ /dev/null @@ -1,7419 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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.longrunning.IOperation|undefined, {}|undefined - ]>; - provisionCloudIdentity( - request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - provisionCloudIdentity( - request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - provisionCloudIdentity( - request?: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - createEntitlement( - request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntitlement( - request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntitlement( - request?: protos.google.cloud.channel.v1.ICreateEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - changeParameters( - request: protos.google.cloud.channel.v1.IChangeParametersRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeParameters( - request: protos.google.cloud.channel.v1.IChangeParametersRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeParameters( - request?: protos.google.cloud.channel.v1.IChangeParametersRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - changeRenewalSettings( - request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeRenewalSettings( - request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeRenewalSettings( - request?: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - changeOffer( - request: protos.google.cloud.channel.v1.IChangeOfferRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeOffer( - request: protos.google.cloud.channel.v1.IChangeOfferRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeOffer( - request?: protos.google.cloud.channel.v1.IChangeOfferRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - startPaidService( - request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startPaidService( - request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startPaidService( - request?: protos.google.cloud.channel.v1.IStartPaidServiceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - suspendEntitlement( - request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suspendEntitlement( - request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suspendEntitlement( - request?: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - cancelEntitlement( - request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelEntitlement( - request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelEntitlement( - request?: protos.google.cloud.channel.v1.ICancelEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - activateEntitlement( - request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - activateEntitlement( - request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - activateEntitlement( - request?: protos.google.cloud.channel.v1.IActivateEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - transferEntitlements( - request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlements( - request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlements( - request?: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - transferEntitlementsToGoogle( - request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlementsToGoogle( - request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlementsToGoogle( - request?: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.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>{ - 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; - } - /** - * 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json deleted file mode 100644 index 625117c33e1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json deleted file mode 100644 index aff1dcc4ca3..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "../../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/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json deleted file mode 100644 index ae5f1241294..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,577 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts deleted file mode 100644 index 503f298a0d2..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 00977d9b464..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 730a061ac94..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts b/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts deleted file mode 100644 index 557a57558e1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts deleted file mode 100644 index 1dfadbbe14f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts +++ /dev/null @@ -1,1511 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts deleted file mode 100644 index f7d4a0ccdec..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts +++ /dev/null @@ -1,7940 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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/owl-bot-staging/google-cloud-channel/v1/tsconfig.json b/owl-bot-staging/google-cloud-channel/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/webpack.config.js b/owl-bot-staging/google-cloud-channel/v1/webpack.config.js deleted file mode 100644 index 8d1a69f3594..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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/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 index fb301586ea8..d0607af278c 100644 --- 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 @@ -26,7 +26,9 @@ 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. +// 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. @@ -72,24 +74,29 @@ message ChannelPartnerLink { 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]; + 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]; + 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]; + 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]; + 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. + // 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]; -} + CloudIdentityInfo channel_partner_cloud_identity_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} \ No newline at end of file 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 index 175d044e63b..2380722ac8d 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto @@ -149,4 +149,4 @@ message AdminUser { // Family name of the admin user. string family_name = 3; -} +} \ No newline at end of file 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 index e34432f2e67..18bf1ad99a1 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto @@ -45,7 +45,8 @@ message Customer { // 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]; + google.type.PostalAddress org_postal_address = 3 + [(google.api.field_behavior) = REQUIRED]; // Primary contact info. ContactInfo primary_contact_info = 4; @@ -62,10 +63,12 @@ message Customer { 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]; + 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]; + 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. @@ -78,7 +81,8 @@ message Customer { // 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]; + 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. @@ -107,4 +111,4 @@ message ContactInfo { // The customer account's contact phone number. string phone = 7; -} +} \ No newline at end of file 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 index 35da239384e..8a6633b140c 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto @@ -47,7 +47,9 @@ message Entitlement { SUSPENDED = 5; } - // Suspension reason for an entitlement if [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] = SUSPENDED. + // Suspension reason for an entitlement if + // [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] + // = SUSPENDED. enum SuspensionReason { // Not used. SUSPENSION_REASON_UNSPECIFIED = 0; @@ -74,10 +76,12 @@ message Entitlement { 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]; + 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]; + 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}. @@ -93,19 +97,23 @@ message Entitlement { CommitmentSettings commitment_settings = 12; // Output only. Current provisioning state of the entitlement. - ProvisioningState provisioning_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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. + 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. @@ -136,9 +144,9 @@ message Parameter { // 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. + // 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]; } @@ -146,32 +154,35 @@ message Parameter { 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" - }]; + 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 + // 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. + // 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. + // 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]; + 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]; + 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]; @@ -218,7 +229,8 @@ message TransferableSku { // 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. + // Optional. The customer to transfer has an entitlement with the populated + // legacy SKU. Sku legacy_sku = 12 [(google.api.field_behavior) = OPTIONAL]; } @@ -247,4 +259,4 @@ message TransferEligibility { // Specified the reason for ineligibility. Reason ineligibility_reason = 3; -} +} \ No newline at end of file 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 index ebe698e1f54..3a504045350 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto @@ -125,8 +125,8 @@ enum PeriodType { } // 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. +// 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" @@ -156,7 +156,8 @@ message Offer { 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]; + 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; @@ -326,4 +327,4 @@ message Period { // Period Type. PeriodType period_type = 2; -} +} \ No newline at end of file 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 index ad432919bf7..e9e190772cb 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto @@ -21,7 +21,8 @@ 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]. +// Provides contextual information about a +// [google.longrunning.Operation][google.longrunning.Operation]. message OperationMetadata { // RPCs that return a Long Running Operation. enum OperationType { @@ -64,4 +65,4 @@ message OperationMetadata { // The RPC that initiated this Long Running Operation. OperationType operation_type = 1; -} +} \ No newline at end of file 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 index 8dc39767a96..411e1698b96 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto @@ -91,4 +91,4 @@ message Media { // Type of the media. MediaType type = 3; -} +} \ No newline at end of file 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 index 464061766cf..1cb87124cb6 100644 --- 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 @@ -38,7 +38,8 @@ option java_package = "com.google.cloud.channel.v1"; // 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"; + 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`). @@ -62,7 +63,8 @@ service CloudChannelReportsService { // 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 + // [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) = { @@ -75,8 +77,10 @@ service CloudChannelReportsService { }; } - // Retrieves data generated by [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. - rpc FetchReportResults(FetchReportResultsRequest) returns (FetchReportResultsResponse) { + // 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: "*" @@ -94,10 +98,11 @@ service CloudChannelReportsService { } } -// Request message for [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. +// 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, + // 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} @@ -111,8 +116,8 @@ message RunReportJobRequest { // 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. + // 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. @@ -130,9 +135,11 @@ message RunReportJobRequest { string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. +// 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] + // 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; @@ -142,9 +149,11 @@ message RunReportJobResponse { ReportResultsMetadata report_metadata = 2; } -// Request message for [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. +// 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]. + // 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 [ @@ -154,9 +163,9 @@ message FetchReportResultsRequest { } ]; - // 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). + // 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. @@ -164,12 +173,15 @@ message FetchReportResultsRequest { // 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. + // [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]. +// 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 @@ -180,27 +192,30 @@ message FetchReportResultsResponse { // 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. + // 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]. +// 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} + // 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. + // 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. + // [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 @@ -210,18 +225,21 @@ message ListReportsRequest { string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelReportsService.ListReports][google.cloud.channel.v1.CloudChannelReportsService.ListReports]. +// 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. + // 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. +// [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" @@ -238,7 +256,8 @@ message ReportJob { } // The features describing the data. Returned by -// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob] and +// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob] +// and // [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. message ReportResultsMetadata { // Details of the completed report. @@ -404,9 +423,9 @@ message 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`). + // 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} @@ -422,4 +441,4 @@ message Report { // A description of other aspects of the report, such as the products // it supports. string description = 4; -} +} \ No newline at end of file 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 index 7cc2f26072c..1a15067b378 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto @@ -54,14 +54,16 @@ message CustomerRepricingConfig { // 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. + // 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]; + // 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 @@ -77,14 +79,16 @@ message ChannelPartnerRepricingConfig { // 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. + // 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]; + // 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. @@ -95,16 +99,14 @@ message RepricingConfig { // Format: // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} string entitlement = 1 [(google.api.resource_reference) = { - type: "cloudchannel.googleapis.com/Entitlement" - }]; + 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 { - - } + message ChannelPartnerGranularity {} // Required. Defines the granularity for repricing. oneof granularity { @@ -117,16 +119,23 @@ message RepricingConfig { 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. 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. + // 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]; + + // The conditional overrides to apply for this configuration. If you list + // multiple overrides, only the first valid override is used. If you don't + // list any overrides, the API uses the normal adjustment and rebilling basis. + repeated ConditionalOverride conditional_overrides = 6; } // A type that represents the various adjustments you can apply to a bill. @@ -147,3 +156,39 @@ message PercentageAdjustment { // Pass-Through => "0.00" google.type.Decimal percentage = 2; } + +// Specifies the override to conditionally apply. +message ConditionalOverride { + // Required. Information about the applied override's adjustment. + RepricingAdjustment adjustment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to + // use for the applied override. Shows the relative cost based on your + // repricing costs. + RebillingBasis rebilling_basis = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the condition which, if met, will apply the override. + RepricingCondition repricing_condition = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the various repricing conditions you can use for a conditional +// override. +message RepricingCondition { + // Represents the types of existing conditional statements. + oneof condition { + // SKU Group condition for override. + SkuGroupCondition sku_group_condition = 1; + } +} + +// A condition that applies the override if a line item SKU is found in the SKU +// group. +message SkuGroupCondition { + // Specifies a SKU group (https://cloud.google.com/skus/sku-groups). + // Resource name of SKU group. Format: + // accounts/{account}/skuGroups/{sku_group}. + // Example: + // "accounts/C01234/skuGroups/3d50fd57-3157-4577-a5a9-a219b8490041". + string sku_group = 1; +} \ No newline at end of file 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 index bbb092e181f..93730e9ea33 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto @@ -46,18 +46,20 @@ option java_package = "com.google.cloud.channel.v1"; // 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. +// - [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. +// - [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. +// - [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"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/apps.order"; // List [Customer][google.cloud.channel.v1.Customer]s. // @@ -68,7 +70,8 @@ service CloudChannelService { // * 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. + // 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" @@ -78,7 +81,8 @@ service CloudChannelService { }; } - // Returns the requested [Customer][google.cloud.channel.v1.Customer] resource. + // Returns the requested [Customer][google.cloud.channel.v1.Customer] + // resource. // // Possible error codes: // @@ -111,20 +115,24 @@ service CloudChannelService { // * 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) + // 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) { + // 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. + // Creates a new [Customer][google.cloud.channel.v1.Customer] resource under + // the reseller or distributor account. // // Possible error codes: // @@ -147,15 +155,16 @@ service CloudChannelService { }; } - // Updates an existing [Customer][google.cloud.channel.v1.Customer] resource for the reseller or - // distributor. + // 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. + // * 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. @@ -178,7 +187,8 @@ service CloudChannelService { // 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. + // * 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/*}" @@ -189,10 +199,10 @@ service CloudChannelService { 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. + // 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: // @@ -238,7 +248,8 @@ service CloudChannelService { // 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) { + rpc ProvisionCloudIdentity(ProvisionCloudIdentityRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{customer=accounts/*/customers/*}:provisionCloudIdentity" body: "*" @@ -249,7 +260,8 @@ service CloudChannelService { }; } - // Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. + // Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a + // customer. // // Possible error codes: // @@ -257,15 +269,17 @@ service CloudChannelService { // * 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) { + // 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. + // 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 @@ -281,16 +295,18 @@ service CloudChannelService { // * 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) { + // 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. + // 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 @@ -307,15 +323,18 @@ service CloudChannelService { // * 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) { + // 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. + // Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] + // resource. // // Possible error codes: // @@ -367,7 +386,8 @@ service CloudChannelService { // 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) { + rpc CreateEntitlement(CreateEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=accounts/*/customers/*}/entitlements" body: "*" @@ -401,7 +421,8 @@ service CloudChannelService { // 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) { + rpc ChangeParameters(ChangeParametersRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeParameters" body: "*" @@ -435,7 +456,8 @@ service CloudChannelService { // 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) { + rpc ChangeRenewalSettings(ChangeRenewalSettingsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeRenewalSettings" body: "*" @@ -502,7 +524,8 @@ service CloudChannelService { // 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) { + rpc StartPaidService(StartPaidServiceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:startPaidService" body: "*" @@ -534,7 +557,8 @@ service CloudChannelService { // 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) { + rpc SuspendEntitlement(SuspendEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:suspend" body: "*" @@ -571,7 +595,8 @@ service CloudChannelService { // 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) { + rpc CancelEntitlement(CancelEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:cancel" body: "*" @@ -609,7 +634,8 @@ service CloudChannelService { // 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) { + rpc ActivateEntitlement(ActivateEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:activate" body: "*" @@ -649,7 +675,8 @@ service CloudChannelService { // 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) { + rpc TransferEntitlements(TransferEntitlementsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=accounts/*/customers/*}:transferEntitlements" body: "*" @@ -689,7 +716,8 @@ service CloudChannelService { // 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) { + rpc TransferEntitlementsToGoogle(TransferEntitlementsToGoogleRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=accounts/*/customers/*}:transferEntitlementsToGoogle" body: "*" @@ -700,8 +728,8 @@ service CloudChannelService { }; } - // List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s belonging to a distributor. - // You must be a distributor to call this method. + // List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s + // belonging to a distributor. You must be a distributor to call this method. // // Possible error codes: // @@ -710,14 +738,17 @@ service CloudChannelService { // * 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) { + // 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. + // Returns the requested + // [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. // You must be a distributor to call this method. // // Possible error codes: @@ -729,8 +760,10 @@ service CloudChannelService { // invalid channel partner link name. // // Return value: - // The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. - rpc GetChannelPartnerLink(GetChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + // The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] + // resource. + rpc GetChannelPartnerLink(GetChannelPartnerLinkRequest) + returns (ChannelPartnerLink) { option (google.api.http) = { get: "/v1/{name=accounts/*/channelPartnerLinks/*}" }; @@ -757,8 +790,10 @@ service CloudChannelService { // Contact Cloud Channel support. // // Return value: - // The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. - rpc CreateChannelPartnerLink(CreateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + // 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" @@ -785,8 +820,10 @@ service CloudChannelService { // Contact Cloud Channel support. // // Return value: - // The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. - rpc UpdateChannelPartnerLink(UpdateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + // The updated + // [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + rpc UpdateChannelPartnerLink(UpdateChannelPartnerLinkRequest) + returns (ChannelPartnerLink) { option (google.api.http) = { patch: "/v1/{name=accounts/*/channelPartnerLinks/*}" body: "*" @@ -800,14 +837,18 @@ service CloudChannelService { // // * 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. + // * 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) { + // 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/*}" }; @@ -821,21 +862,25 @@ service CloudChannelService { // // * 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. + // * 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: + // 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) { + rpc ListCustomerRepricingConfigs(ListCustomerRepricingConfigsRequest) + returns (ListCustomerRepricingConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs" }; @@ -844,9 +889,9 @@ service CloudChannelService { // 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. + // [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 @@ -860,9 +905,11 @@ service CloudChannelService { // 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 + // 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: @@ -872,15 +919,18 @@ service CloudChannelService { // * 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. + // * 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) { + // 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" @@ -893,10 +943,11 @@ service CloudChannelService { // 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]. + // [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: // @@ -909,15 +960,18 @@ service CloudChannelService { // * 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. + // * 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) { + // 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" @@ -925,20 +979,25 @@ service CloudChannelService { 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. + // 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) { + // * 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/*}" }; @@ -952,14 +1011,18 @@ service CloudChannelService { // // * 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. + // * 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) { + // 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/*}" }; @@ -973,20 +1036,25 @@ service CloudChannelService { // // * 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. + // * 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: + // 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) { + rpc ListChannelPartnerRepricingConfigs( + ListChannelPartnerRepricingConfigsRequest) + returns (ListChannelPartnerRepricingConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs" }; @@ -995,9 +1063,10 @@ service CloudChannelService { // 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. + // 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 @@ -1011,8 +1080,9 @@ service CloudChannelService { // 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 + // * 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: @@ -1022,20 +1092,25 @@ service CloudChannelService { // * 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. + // * 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) { + // 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"; + option (google.api.method_signature) = + "parent,channel_partner_repricing_config"; } // Updates a ChannelPartnerRepricingConfig. Call this method to set @@ -1043,10 +1118,11 @@ service CloudChannelService { // 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]. + // [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: // @@ -1059,15 +1135,19 @@ service CloudChannelService { // * 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. + // * 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) { + // 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" @@ -1075,20 +1155,26 @@ service CloudChannelService { 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. + // 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) { + // * 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/*}" }; @@ -1153,7 +1239,8 @@ service CloudChannelService { // // * PERMISSION_DENIED: The customer doesn't belong to the reseller. // * INVALID_ARGUMENT: Required request parameters are missing or invalid. - rpc ListPurchasableSkus(ListPurchasableSkusRequest) returns (ListPurchasableSkusResponse) { + rpc ListPurchasableSkus(ListPurchasableSkusRequest) + returns (ListPurchasableSkusResponse) { option (google.api.http) = { get: "/v1/{customer=accounts/*/customers/*}:listPurchasableSkus" }; @@ -1168,7 +1255,8 @@ service CloudChannelService { // // * PERMISSION_DENIED: The customer doesn't belong to the reseller // * INVALID_ARGUMENT: Required request parameters are missing or invalid. - rpc ListPurchasableOffers(ListPurchasableOffersRequest) returns (ListPurchasableOffersResponse) { + rpc ListPurchasableOffers(ListPurchasableOffersRequest) + returns (ListPurchasableOffersResponse) { option (google.api.http) = { get: "/v1/{customer=accounts/*/customers/*}:listPurchasableOffers" }; @@ -1176,7 +1264,8 @@ service CloudChannelService { // 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] + // subscriber, you get the events through + // [SubscriberEvent][google.cloud.channel.v1.SubscriberEvent] // // Possible error codes: // @@ -1191,7 +1280,8 @@ service CloudChannelService { // // Return value: // The topic name with the registered service email address. - rpc RegisterSubscriber(RegisterSubscriberRequest) returns (RegisterSubscriberResponse) { + rpc RegisterSubscriber(RegisterSubscriberRequest) + returns (RegisterSubscriberResponse) { option (google.api.http) = { post: "/v1/{account=accounts/*}:register" body: "*" @@ -1219,7 +1309,8 @@ service CloudChannelService { // 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) { + rpc UnregisterSubscriber(UnregisterSubscriberRequest) + returns (UnregisterSubscriberResponse) { option (google.api.http) = { post: "/v1/{account=accounts/*}:unregister" body: "*" @@ -1243,14 +1334,16 @@ service CloudChannelService { // // Return value: // A list of service email addresses. - rpc ListSubscribers(ListSubscribersRequest) returns (ListSubscribersResponse) { + 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]. +// 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} @@ -1287,40 +1380,48 @@ message CheckCloudIdentityAccountsExistResponse { repeated CloudIdentityCustomerAccount cloud_identity_accounts = 1; } -// Request message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] +// 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 + // 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. + // [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 + // 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]. +// 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. + // 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]. +// 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} @@ -1332,17 +1433,19 @@ message GetCustomerRequest { ]; } -// Request message for [CloudChannelService.CreateCustomer][google.cloud.channel.v1.CloudChannelService.CreateCustomer] +// 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} + // 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]. +// 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]; @@ -1352,7 +1455,8 @@ message UpdateCustomerRequest { google.protobuf.FieldMask update_mask = 3; } -// Request message for [CloudChannelService.DeleteCustomer][google.cloud.channel.v1.CloudChannelService.DeleteCustomer]. +// 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 [ @@ -1363,7 +1467,8 @@ message DeleteCustomerRequest { ]; } -// Request message for [CloudChannelService.ImportCustomer][google.cloud.channel.v1.CloudChannelService.ImportCustomer] +// 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 @@ -1393,9 +1498,10 @@ message ImportCustomerRequest { // 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. + // 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 @@ -1409,7 +1515,8 @@ message ImportCustomerRequest { ]; } -// Request message for [CloudChannelService.ProvisionCloudIdentity][google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity] +// 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} @@ -1430,7 +1537,8 @@ message ProvisionCloudIdentityRequest { bool validate_only = 4; } -// Request message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] +// 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. @@ -1442,29 +1550,35 @@ message ListEntitlementsRequest { } ]; - // 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. + // 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. + // [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]. +// 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. + // 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] +// 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 @@ -1492,9 +1606,10 @@ message ListTransferableSkusRequest { // 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. + // [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 @@ -1510,18 +1625,21 @@ message ListTransferableSkusRequest { string language_code = 6; } -// Response message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus]. +// 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. + // 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] +// 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 @@ -1545,8 +1663,10 @@ message ListTransferableOffersRequest { // 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. + // [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. @@ -1558,15 +1678,17 @@ message ListTransferableOffersRequest { string language_code = 7 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers]. +// 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. + // Pass to + // [ListTransferableOffersRequest.page_token][google.cloud.channel.v1.ListTransferableOffersRequest.page_token] + // to obtain that page. string next_page_token = 2; } @@ -1577,7 +1699,8 @@ message TransferableOffer { Offer offer = 1; } -// Request message for [CloudChannelService.GetEntitlement][google.cloud.channel.v1.CloudChannelService.GetEntitlement]. +// 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: @@ -1590,39 +1713,45 @@ message GetEntitlementRequest { ]; } -// Request message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] +// 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} + // 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. + // 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. + // [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]. +// 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. + // 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]. +// 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} @@ -1633,7 +1762,8 @@ message GetChannelPartnerLinkRequest { ChannelPartnerLinkView view = 2 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.CreateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink] +// 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. @@ -1643,27 +1773,32 @@ message CreateChannelPartnerLinkRequest { // 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]; + ChannelPartnerLink channel_partner_link = 2 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.UpdateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink] +// 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 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]; + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.GetCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig]. +// Request message for +// [CloudChannelService.GetCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig]. message GetCustomerRepricingConfigRequest { // Required. The resource name of the CustomerRepricingConfig. // Format: @@ -1676,7 +1811,8 @@ message GetCustomerRepricingConfigRequest { ]; } -// Request message for [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs]. +// 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}. @@ -1689,15 +1825,17 @@ message ListCustomerRepricingConfigsRequest { } ]; - // 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. + // 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. + // [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] @@ -1710,21 +1848,25 @@ message ListCustomerRepricingConfigsRequest { string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs]. +// 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. + // 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]. +// 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} + // 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) = { @@ -1733,19 +1875,23 @@ message CreateCustomerRepricingConfigRequest { ]; // Required. The CustomerRepricingConfig object to update. - CustomerRepricingConfig customer_repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; + CustomerRepricingConfig customer_repricing_config = 2 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.UpdateCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfig]. +// 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]; + CustomerRepricingConfig customer_repricing_config = 1 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.DeleteCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfig]. +// 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: + // 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, @@ -1755,7 +1901,8 @@ message DeleteCustomerRepricingConfigRequest { ]; } -// Request message for [CloudChannelService.GetChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig] +// Request message for +// [CloudChannelService.GetChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig] message GetChannelPartnerRepricingConfigRequest { // Required. The resource name of the ChannelPartnerRepricingConfig // Format: @@ -1771,8 +1918,9 @@ message GetChannelPartnerRepricingConfigRequest { // 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: + // 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. @@ -1783,21 +1931,23 @@ message ListChannelPartnerRepricingConfigsRequest { } ]; - // 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. + // 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. + // [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 + // 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 = @@ -1813,16 +1963,17 @@ message ListChannelPartnerRepricingConfigsResponse { 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. + // 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: + // 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, @@ -1832,19 +1983,22 @@ message CreateChannelPartnerRepricingConfigRequest { ]; // Required. The ChannelPartnerRepricingConfig object to update. - ChannelPartnerRepricingConfig channel_partner_repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; + 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]; + 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. + // 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) = { @@ -1853,11 +2007,12 @@ message DeleteChannelPartnerRepricingConfigRequest { ]; } -// Request message for [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement] +// 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} + // 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) = { @@ -1868,8 +2023,9 @@ message CreateEntitlementRequest { // 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. + // 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 @@ -1882,15 +2038,17 @@ message CreateEntitlementRequest { string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +// 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} + // 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]; + 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 @@ -1898,8 +2056,9 @@ message TransferEntitlementsRequest { // 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. + // 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 @@ -1912,25 +2071,29 @@ message TransferEntitlementsRequest { string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +// 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]. +// 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} + // 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]; + 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. + // 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 @@ -1950,14 +2113,17 @@ message ChangeParametersRequest { // 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. + // 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. + // [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. + // 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 @@ -1973,7 +2139,8 @@ message ChangeParametersRequest { string purchase_order_id = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.ChangeRenewalSettings][google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings]. +// 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: @@ -1983,8 +2150,9 @@ message ChangeRenewalSettingsRequest { // 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. + // 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 @@ -1997,7 +2165,8 @@ message ChangeRenewalSettingsRequest { string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. +// 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: @@ -2013,15 +2182,18 @@ message ChangeOfferRequest { } ]; - // 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. + // 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. + // 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 @@ -2034,15 +2206,17 @@ message ChangeOfferRequest { string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.StartPaidService][google.cloud.channel.v1.CloudChannelService.StartPaidService]. +// 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. + // 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 @@ -2055,15 +2229,17 @@ message StartPaidServiceRequest { string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.CancelEntitlement][google.cloud.channel.v1.CloudChannelService.CancelEntitlement]. +// 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. + // 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 @@ -2076,15 +2252,17 @@ message CancelEntitlementRequest { string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.SuspendEntitlement][google.cloud.channel.v1.CloudChannelService.SuspendEntitlement]. +// 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. + // 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 @@ -2097,15 +2275,17 @@ message SuspendEntitlementRequest { string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.ActivateEntitlement][google.cloud.channel.v1.CloudChannelService.ActivateEntitlement]. +// 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. + // 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 @@ -2137,9 +2317,9 @@ message ListProductsRequest { // 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. + // 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. @@ -2176,9 +2356,9 @@ message ListSkusRequest { // 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. + // 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. @@ -2202,13 +2382,13 @@ message ListSkusResponse { // 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}. + // 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. + // 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. @@ -2248,7 +2428,8 @@ message ListPurchasableSkusRequest { } // List SKUs for upgrading or downgrading an entitlement. Make the purchase - // using [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. + // using + // [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. message ChangeOfferPurchase { // Change Type enum. enum ChangeType { @@ -2289,9 +2470,9 @@ message ListPurchasableSkusRequest { } ]; - // 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. + // 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. @@ -2359,9 +2540,9 @@ message ListPurchasableOffersRequest { } ]; - // 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. + // 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. @@ -2394,7 +2575,8 @@ 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. + // Required. Service account that provides subscriber access to the registered + // topic. string service_account = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -2409,7 +2591,8 @@ 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. + // Required. Service account to unregister from subscriber access to the + // topic. string service_account = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -2424,10 +2607,10 @@ 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. + // 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. @@ -2449,4 +2632,4 @@ message ListSubscribersResponse { // 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; -} +} \ No newline at end of file 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 index 3c67216ed65..0135c066f44 100644 --- 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 @@ -40,8 +40,8 @@ message CustomerEvent { // 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: "cloudchannel.googleapis.com/Customer" + }]; // Type of event which happened on the customer. Type event_type = 2; @@ -97,8 +97,8 @@ message EntitlementEvent { // 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: "cloudchannel.googleapis.com/Entitlement" + }]; // Type of event which happened on the entitlement. Type event_type = 2; @@ -116,4 +116,4 @@ message SubscriberEvent { // Entitlement event sent as part of Pub/Sub event to partners. EntitlementEvent entitlement_event = 2; } -} +} \ No newline at end of file diff --git a/packages/google-cloud-channel/protos/protos.d.ts b/packages/google-cloud-channel/protos/protos.d.ts index 7d3c465c6f1..f3029af8a6c 100644 --- a/packages/google-cloud-channel/protos/protos.d.ts +++ b/packages/google-cloud-channel/protos/protos.d.ts @@ -5710,6 +5710,9 @@ export namespace google { /** RepricingConfig rebillingBasis */ rebillingBasis?: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis|null); + + /** RepricingConfig conditionalOverrides */ + conditionalOverrides?: (google.cloud.channel.v1.IConditionalOverride[]|null); } /** Represents a RepricingConfig. */ @@ -5736,6 +5739,9 @@ export namespace google { /** RepricingConfig rebillingBasis. */ public rebillingBasis: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis); + /** RepricingConfig conditionalOverrides. */ + public conditionalOverrides: google.cloud.channel.v1.IConditionalOverride[]; + /** RepricingConfig granularity. */ public granularity?: ("entitlementGranularity"|"channelPartnerGranularity"); @@ -6205,6 +6211,312 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ConditionalOverride. */ + interface IConditionalOverride { + + /** ConditionalOverride adjustment */ + adjustment?: (google.cloud.channel.v1.IRepricingAdjustment|null); + + /** ConditionalOverride rebillingBasis */ + rebillingBasis?: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis|null); + + /** ConditionalOverride repricingCondition */ + repricingCondition?: (google.cloud.channel.v1.IRepricingCondition|null); + } + + /** Represents a ConditionalOverride. */ + class ConditionalOverride implements IConditionalOverride { + + /** + * Constructs a new ConditionalOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IConditionalOverride); + + /** ConditionalOverride adjustment. */ + public adjustment?: (google.cloud.channel.v1.IRepricingAdjustment|null); + + /** ConditionalOverride rebillingBasis. */ + public rebillingBasis: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis); + + /** ConditionalOverride repricingCondition. */ + public repricingCondition?: (google.cloud.channel.v1.IRepricingCondition|null); + + /** + * Creates a new ConditionalOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionalOverride instance + */ + public static create(properties?: google.cloud.channel.v1.IConditionalOverride): google.cloud.channel.v1.ConditionalOverride; + + /** + * Encodes the specified ConditionalOverride message. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @param message ConditionalOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IConditionalOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionalOverride message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @param message ConditionalOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IConditionalOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionalOverride + * @throws {Error} If the payload is not a 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.ConditionalOverride; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionalOverride + * @throws {Error} If the payload is 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.ConditionalOverride; + + /** + * Verifies a ConditionalOverride message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionalOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionalOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ConditionalOverride; + + /** + * Creates a plain object from a ConditionalOverride message. Also converts values to other types if specified. + * @param message ConditionalOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ConditionalOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionalOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionalOverride + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RepricingCondition. */ + interface IRepricingCondition { + + /** RepricingCondition skuGroupCondition */ + skuGroupCondition?: (google.cloud.channel.v1.ISkuGroupCondition|null); + } + + /** Represents a RepricingCondition. */ + class RepricingCondition implements IRepricingCondition { + + /** + * Constructs a new RepricingCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRepricingCondition); + + /** RepricingCondition skuGroupCondition. */ + public skuGroupCondition?: (google.cloud.channel.v1.ISkuGroupCondition|null); + + /** RepricingCondition condition. */ + public condition?: "skuGroupCondition"; + + /** + * Creates a new RepricingCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns RepricingCondition instance + */ + public static create(properties?: google.cloud.channel.v1.IRepricingCondition): google.cloud.channel.v1.RepricingCondition; + + /** + * Encodes the specified RepricingCondition message. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @param message RepricingCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRepricingCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepricingCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @param message RepricingCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRepricingCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepricingCondition + * @throws {Error} If the payload is not a 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.RepricingCondition; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepricingCondition + * @throws {Error} If the payload is 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.RepricingCondition; + + /** + * Verifies a RepricingCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepricingCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepricingCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RepricingCondition; + + /** + * Creates a plain object from a RepricingCondition message. Also converts values to other types if specified. + * @param message RepricingCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RepricingCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepricingCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepricingCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SkuGroupCondition. */ + interface ISkuGroupCondition { + + /** SkuGroupCondition skuGroup */ + skuGroup?: (string|null); + } + + /** Represents a SkuGroupCondition. */ + class SkuGroupCondition implements ISkuGroupCondition { + + /** + * Constructs a new SkuGroupCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ISkuGroupCondition); + + /** SkuGroupCondition skuGroup. */ + public skuGroup: string; + + /** + * Creates a new SkuGroupCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns SkuGroupCondition instance + */ + public static create(properties?: google.cloud.channel.v1.ISkuGroupCondition): google.cloud.channel.v1.SkuGroupCondition; + + /** + * Encodes the specified SkuGroupCondition message. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @param message SkuGroupCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ISkuGroupCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkuGroupCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @param message SkuGroupCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ISkuGroupCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkuGroupCondition + * @throws {Error} If the payload is not a 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.SkuGroupCondition; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkuGroupCondition + * @throws {Error} If the payload is 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.SkuGroupCondition; + + /** + * Verifies a SkuGroupCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkuGroupCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkuGroupCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.SkuGroupCondition; + + /** + * Creates a plain object from a SkuGroupCondition message. Also converts values to other types if specified. + * @param message SkuGroupCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.SkuGroupCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkuGroupCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkuGroupCondition + * @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 { diff --git a/packages/google-cloud-channel/protos/protos.js b/packages/google-cloud-channel/protos/protos.js index 11e2391eb56..2cbe30cbddd 100644 --- a/packages/google-cloud-channel/protos/protos.js +++ b/packages/google-cloud-channel/protos/protos.js @@ -14771,6 +14771,7 @@ * @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 + * @property {Array.|null} [conditionalOverrides] RepricingConfig conditionalOverrides */ /** @@ -14782,6 +14783,7 @@ * @param {google.cloud.channel.v1.IRepricingConfig=} [properties] Properties to set */ function RepricingConfig(properties) { + this.conditionalOverrides = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14828,6 +14830,14 @@ */ RepricingConfig.prototype.rebillingBasis = 0; + /** + * RepricingConfig conditionalOverrides. + * @member {Array.} conditionalOverrides + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.conditionalOverrides = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -14876,6 +14886,9 @@ $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(); + if (message.conditionalOverrides != null && message.conditionalOverrides.length) + for (var i = 0; i < message.conditionalOverrides.length; ++i) + $root.google.cloud.channel.v1.ConditionalOverride.encode(message.conditionalOverrides[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -14930,6 +14943,12 @@ message.rebillingBasis = reader.int32(); break; } + case 6: { + if (!(message.conditionalOverrides && message.conditionalOverrides.length)) + message.conditionalOverrides = []; + message.conditionalOverrides.push($root.google.cloud.channel.v1.ConditionalOverride.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -15003,6 +15022,15 @@ case 2: break; } + if (message.conditionalOverrides != null && message.hasOwnProperty("conditionalOverrides")) { + if (!Array.isArray(message.conditionalOverrides)) + return "conditionalOverrides: array expected"; + for (var i = 0; i < message.conditionalOverrides.length; ++i) { + var error = $root.google.cloud.channel.v1.ConditionalOverride.verify(message.conditionalOverrides[i]); + if (error) + return "conditionalOverrides." + error; + } + } return null; }; @@ -15058,6 +15086,16 @@ message.rebillingBasis = 2; break; } + if (object.conditionalOverrides) { + if (!Array.isArray(object.conditionalOverrides)) + throw TypeError(".google.cloud.channel.v1.RepricingConfig.conditionalOverrides: array expected"); + message.conditionalOverrides = []; + for (var i = 0; i < object.conditionalOverrides.length; ++i) { + if (typeof object.conditionalOverrides[i] !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingConfig.conditionalOverrides: object expected"); + message.conditionalOverrides[i] = $root.google.cloud.channel.v1.ConditionalOverride.fromObject(object.conditionalOverrides[i]); + } + } return message; }; @@ -15074,6 +15112,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.conditionalOverrides = []; if (options.defaults) { object.effectiveInvoiceMonth = null; object.adjustment = null; @@ -15095,6 +15135,11 @@ if (options.oneofs) object.granularity = "channelPartnerGranularity"; } + if (message.conditionalOverrides && message.conditionalOverrides.length) { + object.conditionalOverrides = []; + for (var j = 0; j < message.conditionalOverrides.length; ++j) + object.conditionalOverrides[j] = $root.google.cloud.channel.v1.ConditionalOverride.toObject(message.conditionalOverrides[j], options); + } return object; }; @@ -15940,6 +15985,720 @@ return PercentageAdjustment; })(); + v1.ConditionalOverride = (function() { + + /** + * Properties of a ConditionalOverride. + * @memberof google.cloud.channel.v1 + * @interface IConditionalOverride + * @property {google.cloud.channel.v1.IRepricingAdjustment|null} [adjustment] ConditionalOverride adjustment + * @property {google.cloud.channel.v1.RebillingBasis|null} [rebillingBasis] ConditionalOverride rebillingBasis + * @property {google.cloud.channel.v1.IRepricingCondition|null} [repricingCondition] ConditionalOverride repricingCondition + */ + + /** + * Constructs a new ConditionalOverride. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ConditionalOverride. + * @implements IConditionalOverride + * @constructor + * @param {google.cloud.channel.v1.IConditionalOverride=} [properties] Properties to set + */ + function ConditionalOverride(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionalOverride adjustment. + * @member {google.cloud.channel.v1.IRepricingAdjustment|null|undefined} adjustment + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + */ + ConditionalOverride.prototype.adjustment = null; + + /** + * ConditionalOverride rebillingBasis. + * @member {google.cloud.channel.v1.RebillingBasis} rebillingBasis + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + */ + ConditionalOverride.prototype.rebillingBasis = 0; + + /** + * ConditionalOverride repricingCondition. + * @member {google.cloud.channel.v1.IRepricingCondition|null|undefined} repricingCondition + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + */ + ConditionalOverride.prototype.repricingCondition = null; + + /** + * Creates a new ConditionalOverride instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.IConditionalOverride=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ConditionalOverride} ConditionalOverride instance + */ + ConditionalOverride.create = function create(properties) { + return new ConditionalOverride(properties); + }; + + /** + * Encodes the specified ConditionalOverride message. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.IConditionalOverride} message ConditionalOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adjustment != null && Object.hasOwnProperty.call(message, "adjustment")) + $root.google.cloud.channel.v1.RepricingAdjustment.encode(message.adjustment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rebillingBasis != null && Object.hasOwnProperty.call(message, "rebillingBasis")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rebillingBasis); + if (message.repricingCondition != null && Object.hasOwnProperty.call(message, "repricingCondition")) + $root.google.cloud.channel.v1.RepricingCondition.encode(message.repricingCondition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionalOverride message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.IConditionalOverride} message ConditionalOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ConditionalOverride + * @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.ConditionalOverride} ConditionalOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalOverride.decode = function decode(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.ConditionalOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.adjustment = $root.google.cloud.channel.v1.RepricingAdjustment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rebillingBasis = reader.int32(); + break; + } + case 3: { + message.repricingCondition = $root.google.cloud.channel.v1.RepricingCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ConditionalOverride} ConditionalOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionalOverride message. + * @function verify + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionalOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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; + } + if (message.repricingCondition != null && message.hasOwnProperty("repricingCondition")) { + var error = $root.google.cloud.channel.v1.RepricingCondition.verify(message.repricingCondition); + if (error) + return "repricingCondition." + error; + } + return null; + }; + + /** + * Creates a ConditionalOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ConditionalOverride} ConditionalOverride + */ + ConditionalOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ConditionalOverride) + return object; + var message = new $root.google.cloud.channel.v1.ConditionalOverride(); + if (object.adjustment != null) { + if (typeof object.adjustment !== "object") + throw TypeError(".google.cloud.channel.v1.ConditionalOverride.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; + } + if (object.repricingCondition != null) { + if (typeof object.repricingCondition !== "object") + throw TypeError(".google.cloud.channel.v1.ConditionalOverride.repricingCondition: object expected"); + message.repricingCondition = $root.google.cloud.channel.v1.RepricingCondition.fromObject(object.repricingCondition); + } + return message; + }; + + /** + * Creates a plain object from a ConditionalOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.ConditionalOverride} message ConditionalOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionalOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adjustment = null; + object.rebillingBasis = options.enums === String ? "REBILLING_BASIS_UNSPECIFIED" : 0; + object.repricingCondition = null; + } + 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.repricingCondition != null && message.hasOwnProperty("repricingCondition")) + object.repricingCondition = $root.google.cloud.channel.v1.RepricingCondition.toObject(message.repricingCondition, options); + return object; + }; + + /** + * Converts this ConditionalOverride to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + * @returns {Object.} JSON object + */ + ConditionalOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionalOverride + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionalOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ConditionalOverride"; + }; + + return ConditionalOverride; + })(); + + v1.RepricingCondition = (function() { + + /** + * Properties of a RepricingCondition. + * @memberof google.cloud.channel.v1 + * @interface IRepricingCondition + * @property {google.cloud.channel.v1.ISkuGroupCondition|null} [skuGroupCondition] RepricingCondition skuGroupCondition + */ + + /** + * Constructs a new RepricingCondition. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RepricingCondition. + * @implements IRepricingCondition + * @constructor + * @param {google.cloud.channel.v1.IRepricingCondition=} [properties] Properties to set + */ + function RepricingCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepricingCondition skuGroupCondition. + * @member {google.cloud.channel.v1.ISkuGroupCondition|null|undefined} skuGroupCondition + * @memberof google.cloud.channel.v1.RepricingCondition + * @instance + */ + RepricingCondition.prototype.skuGroupCondition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepricingCondition condition. + * @member {"skuGroupCondition"|undefined} condition + * @memberof google.cloud.channel.v1.RepricingCondition + * @instance + */ + Object.defineProperty(RepricingCondition.prototype, "condition", { + get: $util.oneOfGetter($oneOfFields = ["skuGroupCondition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepricingCondition instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.IRepricingCondition=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RepricingCondition} RepricingCondition instance + */ + RepricingCondition.create = function create(properties) { + return new RepricingCondition(properties); + }; + + /** + * Encodes the specified RepricingCondition message. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.IRepricingCondition} message RepricingCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skuGroupCondition != null && Object.hasOwnProperty.call(message, "skuGroupCondition")) + $root.google.cloud.channel.v1.SkuGroupCondition.encode(message.skuGroupCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepricingCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.IRepricingCondition} message RepricingCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RepricingCondition + * @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.RepricingCondition} RepricingCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingCondition.decode = function decode(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.RepricingCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.skuGroupCondition = $root.google.cloud.channel.v1.SkuGroupCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RepricingCondition} RepricingCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepricingCondition message. + * @function verify + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepricingCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.skuGroupCondition != null && message.hasOwnProperty("skuGroupCondition")) { + properties.condition = 1; + { + var error = $root.google.cloud.channel.v1.SkuGroupCondition.verify(message.skuGroupCondition); + if (error) + return "skuGroupCondition." + error; + } + } + return null; + }; + + /** + * Creates a RepricingCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RepricingCondition} RepricingCondition + */ + RepricingCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RepricingCondition) + return object; + var message = new $root.google.cloud.channel.v1.RepricingCondition(); + if (object.skuGroupCondition != null) { + if (typeof object.skuGroupCondition !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingCondition.skuGroupCondition: object expected"); + message.skuGroupCondition = $root.google.cloud.channel.v1.SkuGroupCondition.fromObject(object.skuGroupCondition); + } + return message; + }; + + /** + * Creates a plain object from a RepricingCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.RepricingCondition} message RepricingCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepricingCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.skuGroupCondition != null && message.hasOwnProperty("skuGroupCondition")) { + object.skuGroupCondition = $root.google.cloud.channel.v1.SkuGroupCondition.toObject(message.skuGroupCondition, options); + if (options.oneofs) + object.condition = "skuGroupCondition"; + } + return object; + }; + + /** + * Converts this RepricingCondition to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RepricingCondition + * @instance + * @returns {Object.} JSON object + */ + RepricingCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepricingCondition + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepricingCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RepricingCondition"; + }; + + return RepricingCondition; + })(); + + v1.SkuGroupCondition = (function() { + + /** + * Properties of a SkuGroupCondition. + * @memberof google.cloud.channel.v1 + * @interface ISkuGroupCondition + * @property {string|null} [skuGroup] SkuGroupCondition skuGroup + */ + + /** + * Constructs a new SkuGroupCondition. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a SkuGroupCondition. + * @implements ISkuGroupCondition + * @constructor + * @param {google.cloud.channel.v1.ISkuGroupCondition=} [properties] Properties to set + */ + function SkuGroupCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkuGroupCondition skuGroup. + * @member {string} skuGroup + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @instance + */ + SkuGroupCondition.prototype.skuGroup = ""; + + /** + * Creates a new SkuGroupCondition instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.ISkuGroupCondition=} [properties] Properties to set + * @returns {google.cloud.channel.v1.SkuGroupCondition} SkuGroupCondition instance + */ + SkuGroupCondition.create = function create(properties) { + return new SkuGroupCondition(properties); + }; + + /** + * Encodes the specified SkuGroupCondition message. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.ISkuGroupCondition} message SkuGroupCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkuGroupCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skuGroup != null && Object.hasOwnProperty.call(message, "skuGroup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.skuGroup); + return writer; + }; + + /** + * Encodes the specified SkuGroupCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.ISkuGroupCondition} message SkuGroupCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkuGroupCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @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.SkuGroupCondition} SkuGroupCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkuGroupCondition.decode = function decode(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.SkuGroupCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.skuGroup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.SkuGroupCondition} SkuGroupCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkuGroupCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkuGroupCondition message. + * @function verify + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkuGroupCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.skuGroup != null && message.hasOwnProperty("skuGroup")) + if (!$util.isString(message.skuGroup)) + return "skuGroup: string expected"; + return null; + }; + + /** + * Creates a SkuGroupCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.SkuGroupCondition} SkuGroupCondition + */ + SkuGroupCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.SkuGroupCondition) + return object; + var message = new $root.google.cloud.channel.v1.SkuGroupCondition(); + if (object.skuGroup != null) + message.skuGroup = String(object.skuGroup); + return message; + }; + + /** + * Creates a plain object from a SkuGroupCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.SkuGroupCondition} message SkuGroupCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkuGroupCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.skuGroup = ""; + if (message.skuGroup != null && message.hasOwnProperty("skuGroup")) + object.skuGroup = message.skuGroup; + return object; + }; + + /** + * Converts this SkuGroupCondition to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @instance + * @returns {Object.} JSON object + */ + SkuGroupCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkuGroupCondition + * @function getTypeUrl + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkuGroupCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.SkuGroupCondition"; + }; + + return SkuGroupCondition; + })(); + v1.CloudChannelService = (function() { /** diff --git a/packages/google-cloud-channel/protos/protos.json b/packages/google-cloud-channel/protos/protos.json index 010e18ce203..21ab38129eb 100644 --- a/packages/google-cloud-channel/protos/protos.json +++ b/packages/google-cloud-channel/protos/protos.json @@ -1491,6 +1491,11 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "conditionalOverrides": { + "rule": "repeated", + "type": "ConditionalOverride", + "id": 6 } }, "nested": { @@ -1533,6 +1538,54 @@ } } }, + "ConditionalOverride": { + "fields": { + "adjustment": { + "type": "RepricingAdjustment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rebillingBasis": { + "type": "RebillingBasis", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repricingCondition": { + "type": "RepricingCondition", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RepricingCondition": { + "oneofs": { + "condition": { + "oneof": [ + "skuGroupCondition" + ] + } + }, + "fields": { + "skuGroupCondition": { + "type": "SkuGroupCondition", + "id": 1 + } + } + }, + "SkuGroupCondition": { + "fields": { + "skuGroup": { + "type": "string", + "id": 1 + } + } + }, "CloudChannelService": { "options": { "(google.api.default_host)": "cloudchannel.googleapis.com", 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 index 2c609bc5595..38703fe5671 100644 --- 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 @@ -29,15 +29,16 @@ function main(reportJob) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The report job created by CloudChannelReportsService.RunReportJob google.cloud.channel.v1.CloudChannelReportsService.RunReportJob. + * 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). + * 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. */ @@ -45,8 +46,10 @@ function main(reportJob) { /** * 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. + * 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' 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 index bf37c0e3bb5..56b561b5f62 100644 --- 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 @@ -29,22 +29,23 @@ function main(parent) { * 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} + * 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. + * 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. + * 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' /** 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 index 8fa60ddbc73..6f1866707ea 100644 --- 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 @@ -29,8 +29,8 @@ function main(name) { * 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, + * 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} @@ -41,8 +41,8 @@ function main(name) { */ // const dateRange = {} /** - * Optional. A structured string that defines conditions on dimension columns to - * restrict the report output. + * 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: 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 index 4f3c8747897..18b3c57f4af 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index c664417d41e..4f89a80116b 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index 67749366e1f..2442ce2baad 100644 --- 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 @@ -40,8 +40,10 @@ function main(name, offer) { */ // 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. + * 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 /** @@ -49,8 +51,9 @@ function main(name, offer) { */ // 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. + * 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 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 index 69c955fbbe2..b4ac8bb935f 100644 --- 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 @@ -35,14 +35,17 @@ function main(name, parameters) { */ // const name = 'abc123' /** - * Required. Entitlement parameters to update. You can only change editable parameters. + * 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. + * 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. + * 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 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 index 71b2d0efda5..a4f56944cbc 100644 --- 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 @@ -39,8 +39,9 @@ function main(name, renewalSettings) { */ // 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. + * 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 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 index ec4b22da1dd..ebddea882f0 100644 --- 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 @@ -29,8 +29,8 @@ function main(parent, channelPartnerRepricingConfig) { * 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: + * 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' 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 index c7ffac50924..869f222ba01 100644 --- 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 @@ -29,8 +29,8 @@ function main(parent, customer) { * 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} + * Required. The resource name of reseller account in which to create the + * customer. Parent uses the format: accounts/{account_id} */ // const parent = 'abc123' /** 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 index d7e9f1980b7..826bdced548 100644 --- 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 @@ -29,8 +29,9 @@ function main(parent, customerRepricingConfig) { * 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} + * 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' /** 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 index f679ab7c6c4..b8659127c46 100644 --- 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 @@ -29,9 +29,9 @@ function main(parent, entitlement) { * 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} + * 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' /** @@ -39,8 +39,9 @@ function main(parent, entitlement) { */ // 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. + * 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 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 index 603a19b09f3..6cc8d7d7392 100644 --- 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 @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the channel partner repricing config rule to delete. + * Required. The resource name of the channel partner repricing config rule to + * delete. */ // const name = 'abc123' 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 index 3337a795604..3722b11cbe5 100644 --- 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 @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the customer repricing config rule to delete. - * Format: + * Required. The resource name of the customer repricing config rule to + * delete. Format: * accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. */ // const name = 'abc123' 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 index 2238a6a769e..790f8400f92 100644 --- 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 @@ -56,9 +56,10 @@ function main(domain, cloudIdentityId, parent, overwriteIfExists) { */ // 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. + * 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' /** 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 index 5e489026828..f15c6488eff 100644 --- 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 @@ -29,22 +29,23 @@ function main(parent) { * 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} + * 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. + * 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. + * 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' /** 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 index 7b94fd53b91..67ae5544814 100644 --- 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 @@ -29,31 +29,34 @@ function main(parent) { * 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: + * 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. + * 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. + * 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 + * 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 = 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 index 10b7419a8a3..147c7372d0c 100644 --- 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 @@ -36,16 +36,18 @@ function main(parent) { */ // 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. + * 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. + * 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' /** 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 index 462fa64938f..c31b53e38ae 100644 --- 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 @@ -34,20 +34,23 @@ function main(parent) { */ // 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 + * 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. + * 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 + * Optional. Filters applied to the CloudChannelService.ListCustomers + * results. See * https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers * for more information. */ 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 index ce44dbcab28..3f8141a1ab0 100644 --- 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 @@ -35,16 +35,18 @@ function main(parent) { */ // 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. + * 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. + * 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' 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 index 1f558b118af..2d5aa523628 100644 --- 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 @@ -29,14 +29,14 @@ function main(parent) { * 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}. + * 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. + * 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 /** 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 index 9f91c77921e..d48a6ed20ec 100644 --- 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 @@ -34,9 +34,9 @@ function main(account) { */ // 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. + * 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 /** 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 index 8c64e9f9784..ce69e278509 100644 --- 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 @@ -42,9 +42,9 @@ function main(customer) { */ // 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. + * 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 /** 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 index ea2114b37a5..bb6bb21c485 100644 --- 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 @@ -42,9 +42,9 @@ function main(customer) { */ // 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. + * 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 /** 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 index 6c85e15d65a..f7c1a1984f1 100644 --- 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 @@ -40,9 +40,9 @@ function main(parent, account) { */ // 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. + * 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 /** 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 index baaa56399db..42416cf9bde 100644 --- 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 @@ -33,10 +33,10 @@ function main(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. + * 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 /** 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 index cbddd152d8e..c4f6fb76c93 100644 --- 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 @@ -50,8 +50,10 @@ function main(parent, sku) { /** * 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. + * 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' /** 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 index feb99ba9ec6..5aa3ba3c98a 100644 --- 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 @@ -54,9 +54,10 @@ function main(parent) { /** * 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. + * 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' /** 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 index a25e0a9dbf1..027099cf1b5 100644 --- 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 @@ -33,7 +33,8 @@ function main(account, serviceAccount) { */ // const account = 'abc123' /** - * Required. Service account that provides subscriber access to the registered topic. + * Required. Service account that provides subscriber access to the registered + * topic. */ // const serviceAccount = 'abc123' 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 index 6140f736ef7..d6989b2956f 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index 736e5f95c44..f908473d2ee 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index 3320c0f434b..f898044ffca 100644 --- 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 @@ -29,9 +29,9 @@ function main(parent, entitlements) { * 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} + * 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' /** @@ -46,8 +46,9 @@ function main(parent, entitlements) { */ // 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. + * 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 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 index ca167240567..f28efb36e02 100644 --- 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 @@ -29,9 +29,9 @@ function main(parent, entitlements) { * 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} + * 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' /** @@ -39,8 +39,9 @@ function main(parent, entitlements) { */ // 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. + * 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 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 index 45cfe161713..2055f05d52c 100644 --- 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 @@ -33,7 +33,8 @@ function main(account, serviceAccount) { */ // const account = 'abc123' /** - * Required. Service account to unregister from subscriber access to the topic. + * Required. Service account to unregister from subscriber access to the + * topic. */ // const serviceAccount = 'abc123' 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 index b21cbef5557..e28cd686492 100644 --- 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 @@ -35,8 +35,8 @@ function main(name, channelPartnerLink, updateMask) { */ // const name = 'abc123' /** - * Required. The channel partner link to update. Only channel_partner_link.link_state - * is allowed for updates. + * Required. The channel partner link to update. Only + * channel_partner_link.link_state is allowed for updates. */ // const channelPartnerLink = {} /** 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 index ab1c91ca689..d79cfb52ef0 100644 --- 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 @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -122,7 +122,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 78, "type": "FULL" } ], @@ -174,7 +174,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -438,7 +438,7 @@ "segments": [ { "start": 25, - "end": 91, + "end": 92, "type": "FULL" } ], @@ -554,7 +554,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 72, "type": "FULL" } ], @@ -602,7 +602,7 @@ "segments": [ { "start": 25, - "end": 96, + "end": 97, "type": "FULL" } ], @@ -666,7 +666,7 @@ "segments": [ { "start": 25, - "end": 88, + "end": 90, "type": "FULL" } ], @@ -770,7 +770,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -818,7 +818,7 @@ "segments": [ { "start": 25, - "end": 79, + "end": 82, "type": "FULL" } ], @@ -870,7 +870,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -918,7 +918,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -974,7 +974,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1018,7 +1018,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1062,7 +1062,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1106,7 +1106,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1150,7 +1150,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 81, "type": "FULL" } ], @@ -1202,7 +1202,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -1250,7 +1250,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 75, "type": "FULL" } ], @@ -1478,7 +1478,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 82, "type": "FULL" } ], @@ -1530,7 +1530,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 60, "type": "FULL" } ], @@ -1694,7 +1694,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -1830,7 +1830,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 54, "type": "FULL" } ], @@ -2194,7 +2194,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ], @@ -2238,7 +2238,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ], 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 index d0eb86dbe62..57dd8de5833 100644 --- 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 @@ -127,6 +127,9 @@ export class CloudChannelReportsServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // 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; @@ -443,22 +446,23 @@ export class CloudChannelReportsServiceClient { * 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.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, + * 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. + * 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. @@ -604,26 +608,30 @@ export class CloudChannelReportsServiceClient { >; } /** - * Retrieves data generated by {@link google.cloud.channel.v1.CloudChannelReportsService.RunReportJob|CloudChannelReportsService.RunReportJob}. + * 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}. + * 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). + * 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. + * {@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. @@ -717,21 +725,24 @@ export class CloudChannelReportsServiceClient { * @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}. + * 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). + * 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. + * {@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} @@ -773,21 +784,24 @@ export class CloudChannelReportsServiceClient { * @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}. + * 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). + * 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. + * {@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} @@ -829,18 +843,19 @@ export class CloudChannelReportsServiceClient { * @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} + * 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. + * 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. + * {@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 @@ -933,18 +948,19 @@ export class CloudChannelReportsServiceClient { * @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} + * 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. + * 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. + * {@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 @@ -991,18 +1007,19 @@ export class CloudChannelReportsServiceClient { * @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} + * 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. + * 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. + * {@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 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 index d75630c36be..381ecff4030 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts @@ -50,15 +50,16 @@ const version = require('../../../package.json').version; * 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.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.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. + * - {@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 */ @@ -141,6 +142,9 @@ export class CloudChannelServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // 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; @@ -650,7 +654,8 @@ export class CloudChannelServiceClient { // -- Service calls -- // ------------------- /** - * Returns the requested {@link google.cloud.channel.v1.Customer|Customer} resource. + * Returns the requested {@link google.cloud.channel.v1.Customer|Customer} + * resource. * * Possible error codes: * @@ -756,11 +761,14 @@ export class CloudChannelServiceClient { * * 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) + * 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. + * no + * {@link google.cloud.channel.v1.CloudIdentityCustomerAccount|CloudIdentityCustomerAccount} + * resources match the domain. * * @param {Object} request * The request object that will be sent. @@ -864,8 +872,8 @@ export class CloudChannelServiceClient { ); } /** - * Creates a new {@link google.cloud.channel.v1.Customer|Customer} resource under the reseller or distributor - * account. + * Creates a new {@link google.cloud.channel.v1.Customer|Customer} resource under + * the reseller or distributor account. * * Possible error codes: * @@ -881,8 +889,8 @@ export class CloudChannelServiceClient { * @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} + * 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] @@ -964,15 +972,16 @@ export class CloudChannelServiceClient { return this.innerApiCalls.createCustomer(request, options, callback); } /** - * Updates an existing {@link google.cloud.channel.v1.Customer|Customer} resource for the reseller or - * distributor. + * 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. + * * 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. @@ -1071,7 +1080,8 @@ export class CloudChannelServiceClient { * 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. + * * 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. @@ -1156,10 +1166,10 @@ export class CloudChannelServiceClient { 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. + * 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: * @@ -1194,9 +1204,10 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -1280,7 +1291,8 @@ export class CloudChannelServiceClient { return this.innerApiCalls.importCustomer(request, options, callback); } /** - * Returns the requested {@link google.cloud.channel.v1.Entitlement|Entitlement} resource. + * Returns the requested {@link google.cloud.channel.v1.Entitlement|Entitlement} + * resource. * * Possible error codes: * @@ -1376,7 +1388,8 @@ export class CloudChannelServiceClient { return this.innerApiCalls.getEntitlement(request, options, callback); } /** - * Returns the requested {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * Returns the requested + * {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. * You must be a distributor to call this method. * * Possible error codes: @@ -1388,7 +1401,8 @@ export class CloudChannelServiceClient { * invalid channel partner link name. * * Return value: - * The {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * The {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} + * resource. * * @param {Object} request * The request object that will be sent. @@ -1504,7 +1518,8 @@ export class CloudChannelServiceClient { * Contact Cloud Channel support. * * Return value: - * The new {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * The new {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} + * resource. * * @param {Object} request * The request object that will be sent. @@ -1631,7 +1646,8 @@ export class CloudChannelServiceClient { * Contact Cloud Channel support. * * Return value: - * The updated {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * The updated + * {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. * * @param {Object} request * The request object that will be sent. @@ -1640,8 +1656,8 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -1748,13 +1764,16 @@ export class CloudChannelServiceClient { * * * 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. + * * 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. + * 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. @@ -1859,9 +1878,9 @@ export class CloudChannelServiceClient { /** * 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. + * {@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 @@ -1875,9 +1894,11 @@ export class CloudChannelServiceClient { * 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 + * 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: @@ -1887,20 +1908,23 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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} + * 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] @@ -2003,10 +2027,11 @@ export class CloudChannelServiceClient { * 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}. + * {@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: * @@ -2019,14 +2044,16 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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. @@ -2128,25 +2155,29 @@ export class CloudChannelServiceClient { ); } /** - * 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. + * 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. + * * 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: + * 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. @@ -2250,13 +2281,16 @@ export class CloudChannelServiceClient { * * * 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. + * * 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. + * 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. @@ -2361,9 +2395,10 @@ export class CloudChannelServiceClient { /** * 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. + * 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 @@ -2377,8 +2412,9 @@ export class CloudChannelServiceClient { * 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 + * * 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: @@ -2388,20 +2424,22 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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: + * 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. @@ -2505,10 +2543,11 @@ export class CloudChannelServiceClient { * 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}. + * {@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: * @@ -2521,14 +2560,16 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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. @@ -2630,24 +2671,29 @@ export class CloudChannelServiceClient { ); } /** - * 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. + * 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. + * * 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. + * 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. @@ -2839,7 +2885,8 @@ export class CloudChannelServiceClient { /** * 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} + * subscriber, you get the events through + * {@link google.cloud.channel.v1.SubscriberEvent|SubscriberEvent} * * Possible error codes: * @@ -2860,7 +2907,8 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -2973,7 +3021,8 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -3269,14 +3318,15 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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 @@ -3449,13 +3499,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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. + * 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 @@ -3632,8 +3685,9 @@ export class CloudChannelServiceClient { * @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. + * 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 @@ -3807,13 +3861,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * 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 @@ -3987,8 +4044,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4159,8 +4217,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4336,8 +4395,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4514,8 +4574,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4690,9 +4751,9 @@ export class CloudChannelServiceClient { * @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} + * 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 @@ -4701,8 +4762,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4877,14 +4939,15 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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 @@ -5039,7 +5102,8 @@ export class CloudChannelServiceClient { * * 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. + * 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. @@ -5047,16 +5111,19 @@ export class CloudChannelServiceClient { * 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 + * 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. + * {@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 + * 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] @@ -5149,16 +5216,19 @@ export class CloudChannelServiceClient { * 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 + * 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. + * {@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 + * 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] @@ -5205,16 +5275,19 @@ export class CloudChannelServiceClient { * 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 + * 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. + * {@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 + * 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] @@ -5252,7 +5325,8 @@ export class CloudChannelServiceClient { ) as AsyncIterable; } /** - * Lists {@link google.cloud.channel.v1.Entitlement|Entitlement}s belonging to a customer. + * Lists {@link google.cloud.channel.v1.Entitlement|Entitlement}s belonging to a + * customer. * * Possible error codes: * @@ -5260,7 +5334,8 @@ export class CloudChannelServiceClient { * * 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. + * A list of the customer's + * {@link google.cloud.channel.v1.Entitlement|Entitlement}s. * * @param {Object} request * The request object that will be sent. @@ -5269,14 +5344,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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. @@ -5374,14 +5451,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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} @@ -5427,14 +5506,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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} @@ -5470,8 +5551,8 @@ export class CloudChannelServiceClient { ) 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. + * 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 @@ -5487,7 +5568,8 @@ export class CloudChannelServiceClient { * * INVALID_ARGUMENT: Required request parameters are missing or invalid. * * Return value: - * A list of the customer's {@link google.cloud.channel.v1.TransferableSku|TransferableSku}. + * A list of the customer's + * {@link google.cloud.channel.v1.TransferableSku|TransferableSku}. * * @param {Object} request * The request object that will be sent. @@ -5509,9 +5591,10 @@ export class CloudChannelServiceClient { * @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. + * {@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 @@ -5632,9 +5715,10 @@ export class CloudChannelServiceClient { * @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. + * {@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 @@ -5703,9 +5787,10 @@ export class CloudChannelServiceClient { * @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. + * {@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 @@ -5751,8 +5836,8 @@ export class CloudChannelServiceClient { ) 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. + * 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 @@ -5769,7 +5854,8 @@ export class CloudChannelServiceClient { * * 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. + * 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. @@ -5787,8 +5873,10 @@ export class CloudChannelServiceClient { * @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. + * {@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] @@ -5905,8 +5993,10 @@ export class CloudChannelServiceClient { * @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. + * {@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] @@ -5967,8 +6057,10 @@ export class CloudChannelServiceClient { * @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. + * {@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] @@ -6010,8 +6102,8 @@ export class CloudChannelServiceClient { ) as AsyncIterable; } /** - * List {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}s belonging to a distributor. - * You must be a distributor to call this method. + * 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: * @@ -6020,23 +6112,25 @@ export class CloudChannelServiceClient { * * 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. + * 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} + * 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. + * 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. + * {@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] @@ -6136,18 +6230,19 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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. + * {@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] @@ -6191,18 +6286,19 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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. + * {@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] @@ -6247,14 +6343,17 @@ export class CloudChannelServiceClient { * * * 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. + * * 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: + * 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} @@ -6270,14 +6369,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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 @@ -6388,14 +6489,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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 @@ -6450,14 +6553,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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 @@ -6508,14 +6613,17 @@ export class CloudChannelServiceClient { * * * 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. + * * 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: + * 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} @@ -6525,25 +6633,28 @@ export class CloudChannelServiceClient { * @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: + * 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. + * 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. + * {@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 + * 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 = @@ -6646,25 +6757,28 @@ export class CloudChannelServiceClient { * @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: + * 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. + * 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. + * {@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 + * 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 = @@ -6712,25 +6826,28 @@ export class CloudChannelServiceClient { * @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: + * 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. + * 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. + * {@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 + * 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 = @@ -6784,9 +6901,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -6879,9 +6996,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -6928,9 +7045,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -6984,9 +7101,9 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -7086,9 +7203,9 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -7144,9 +7261,9 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -7198,12 +7315,12 @@ export class CloudChannelServiceClient { * @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}. + * 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. + * 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] @@ -7301,12 +7418,12 @@ export class CloudChannelServiceClient { * @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}. + * 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. + * 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] @@ -7360,12 +7477,12 @@ export class CloudChannelServiceClient { * @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}. + * 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. + * 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] @@ -7433,9 +7550,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7542,9 +7659,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7599,9 +7716,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7663,9 +7780,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7772,9 +7889,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7829,9 +7946,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7896,10 +8013,10 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -8001,10 +8118,10 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -8054,10 +8171,10 @@ export class CloudChannelServiceClient { * @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. + * 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. From 12f46b9cf3808f968ca21be700c7ec3b52795011 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 9 Dec 2022 18:14:01 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-channel/v1/.eslintignore | 7 - .../google-cloud-channel/v1/.eslintrc.json | 3 - .../google-cloud-channel/v1/.gitignore | 14 - .../google-cloud-channel/v1/.jsdoc.js | 55 - .../google-cloud-channel/v1/.mocharc.js | 33 - .../google-cloud-channel/v1/.prettierrc.js | 22 - .../google-cloud-channel/v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../google-cloud-channel/v1/package.json | 65 - .../channel/v1/channel_partner_links.proto | 102 - .../google/cloud/channel/v1/common.proto | 152 - .../google/cloud/channel/v1/customers.proto | 114 - .../cloud/channel/v1/entitlements.proto | 262 - .../google/cloud/channel/v1/offers.proto | 330 - .../google/cloud/channel/v1/operations.proto | 68 - .../google/cloud/channel/v1/products.proto | 94 - .../cloud/channel/v1/reports_service.proto | 444 - .../google/cloud/channel/v1/repricing.proto | 194 - .../google/cloud/channel/v1/service.proto | 2635 ------ .../cloud/channel/v1/subscriber_event.proto | 119 - ...el_reports_service.fetch_report_results.js | 83 - ...ud_channel_reports_service.list_reports.js | 86 - ..._channel_reports_service.run_report_job.js | 88 - ...ud_channel_service.activate_entitlement.js | 77 - ...loud_channel_service.cancel_entitlement.js | 77 - .../v1/cloud_channel_service.change_offer.js | 94 - ...cloud_channel_service.change_parameters.js | 90 - ...channel_service.change_renewal_settings.js | 82 - ...ice.check_cloud_identity_accounts_exist.js | 67 - ...nel_service.create_channel_partner_link.js | 70 - ...create_channel_partner_repricing_config.js | 68 - .../cloud_channel_service.create_customer.js | 67 - ...ervice.create_customer_repricing_config.js | 68 - ...loud_channel_service.create_entitlement.js | 82 - ...delete_channel_partner_repricing_config.js | 62 - .../cloud_channel_service.delete_customer.js | 61 - ...ervice.delete_customer_repricing_config.js | 63 - ...hannel_service.get_channel_partner_link.js | 67 - ...ce.get_channel_partner_repricing_config.js | 63 - .../v1/cloud_channel_service.get_customer.js | 62 - ...l_service.get_customer_repricing_config.js | 63 - .../cloud_channel_service.get_entitlement.js | 63 - .../cloud_channel_service.import_customer.js | 100 - ...nnel_service.list_channel_partner_links.js | 83 - ....list_channel_partner_repricing_configs.js | 94 - ...service.list_customer_repricing_configs.js | 90 - .../cloud_channel_service.list_customers.js | 86 - ...cloud_channel_service.list_entitlements.js | 80 - .../v1/cloud_channel_service.list_offers.js | 88 - .../v1/cloud_channel_service.list_products.js | 80 - ...channel_service.list_purchasable_offers.js | 88 - ...d_channel_service.list_purchasable_skus.js | 88 - .../v1/cloud_channel_service.list_skus.js | 88 - .../cloud_channel_service.list_subscribers.js | 77 - ...hannel_service.list_transferable_offers.js | 98 - ..._channel_service.list_transferable_skus.js | 105 - .../v1/cloud_channel_service.lookup_offer.js | 63 - ...hannel_service.provision_cloud_identity.js | 75 - ...oud_channel_service.register_subscriber.js | 67 - ...loud_channel_service.start_paid_service.js | 77 - ...oud_channel_service.suspend_entitlement.js | 77 - ...d_channel_service.transfer_entitlements.js | 89 - ...service.transfer_entitlements_to_google.js | 82 - ...d_channel_service.unregister_subscriber.js | 67 - ...nel_service.update_channel_partner_link.js | 76 - ...update_channel_partner_repricing_config.js | 61 - .../cloud_channel_service.update_customer.js | 66 - ...ervice.update_customer_repricing_config.js | 61 - ...ppet_metadata.google.cloud.channel.v1.json | 2323 ----- .../google-cloud-channel/v1/src/index.ts | 27 - .../cloud_channel_reports_service_client.ts | 1515 ---- ...channel_reports_service_client_config.json | 38 - ...ud_channel_reports_service_proto_list.json | 13 - .../v1/src/v1/cloud_channel_service_client.ts | 7419 --------------- .../cloud_channel_service_client_config.json | 263 - .../v1/cloud_channel_service_proto_list.json | 13 - .../v1/src/v1/gapic_metadata.json | 577 -- .../google-cloud-channel/v1/src/v1/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - .../v1/system-test/install.ts | 49 - .../gapic_cloud_channel_reports_service_v1.ts | 1511 ---- .../v1/test/gapic_cloud_channel_service_v1.ts | 7940 ----------------- .../google-cloud-channel/v1/tsconfig.json | 19 - .../google-cloud-channel/v1/webpack.config.js | 64 - .../channel/v1/channel_partner_links.proto | 25 +- .../google/cloud/channel/v1/common.proto | 2 +- .../google/cloud/channel/v1/customers.proto | 14 +- .../cloud/channel/v1/entitlements.proto | 68 +- .../google/cloud/channel/v1/offers.proto | 9 +- .../google/cloud/channel/v1/operations.proto | 5 +- .../google/cloud/channel/v1/products.proto | 2 +- .../cloud/channel/v1/reports_service.proto | 97 +- .../google/cloud/channel/v1/repricing.proto | 89 +- .../google/cloud/channel/v1/service.proto | 795 +- .../cloud/channel/v1/subscriber_event.proto | 10 +- .../google-cloud-channel/protos/protos.d.ts | 312 + .../google-cloud-channel/protos/protos.js | 759 ++ .../google-cloud-channel/protos/protos.json | 53 + ...el_reports_service.fetch_report_results.js | 15 +- ...ud_channel_reports_service.list_reports.js | 17 +- ..._channel_reports_service.run_report_job.js | 8 +- ...ud_channel_service.activate_entitlement.js | 5 +- ...loud_channel_service.cancel_entitlement.js | 5 +- .../v1/cloud_channel_service.change_offer.js | 11 +- ...cloud_channel_service.change_parameters.js | 11 +- ...channel_service.change_renewal_settings.js | 5 +- ...create_channel_partner_repricing_config.js | 4 +- .../cloud_channel_service.create_customer.js | 4 +- ...ervice.create_customer_repricing_config.js | 5 +- ...loud_channel_service.create_entitlement.js | 11 +- ...delete_channel_partner_repricing_config.js | 3 +- ...ervice.delete_customer_repricing_config.js | 4 +- .../cloud_channel_service.import_customer.js | 7 +- ...nnel_service.list_channel_partner_links.js | 17 +- ....list_channel_partner_repricing_configs.js | 25 +- ...service.list_customer_repricing_configs.js | 12 +- .../cloud_channel_service.list_customers.js | 13 +- ...cloud_channel_service.list_entitlements.js | 12 +- .../v1/cloud_channel_service.list_offers.js | 10 +- .../v1/cloud_channel_service.list_products.js | 6 +- ...channel_service.list_purchasable_offers.js | 6 +- ...d_channel_service.list_purchasable_skus.js | 6 +- .../v1/cloud_channel_service.list_skus.js | 6 +- .../cloud_channel_service.list_subscribers.js | 8 +- ...hannel_service.list_transferable_offers.js | 6 +- ..._channel_service.list_transferable_skus.js | 7 +- ...oud_channel_service.register_subscriber.js | 3 +- ...loud_channel_service.start_paid_service.js | 5 +- ...oud_channel_service.suspend_entitlement.js | 5 +- ...d_channel_service.transfer_entitlements.js | 11 +- ...service.transfer_entitlements_to_google.js | 11 +- ...d_channel_service.unregister_subscriber.js | 3 +- ...nel_service.update_channel_partner_link.js | 4 +- ...ppet_metadata.google.cloud.channel.v1.json | 48 +- .../cloud_channel_reports_service_client.ts | 113 +- .../src/v1/cloud_channel_service_client.ts | 779 +- 137 files changed, 2519 insertions(+), 31248 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-channel/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-channel/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-channel/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-channel/v1/.eslintignore b/owl-bot-staging/google-cloud-channel/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json b/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-channel/v1/.gitignore b/owl-bot-staging/google-cloud-channel/v1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.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/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js b/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js deleted file mode 100644 index 40f6e639a6f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/.mocharc.js b/owl-bot-staging/google-cloud-channel/v1/.mocharc.js deleted file mode 100644 index 481c522b00f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js b/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js deleted file mode 100644 index 494e147865d..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-channel/v1/README.md b/owl-bot-staging/google-cloud-channel/v1/README.md deleted file mode 100644 index a83379c9f3a..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Channel: Nodejs Client diff --git a/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json b/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/package.json b/owl-bot-staging/google-cloud-channel/v1/package.json deleted file mode 100644 index aacd717e88b..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@google-cloud/channel", - "version": "0.1.0", - "description": "Channel client for Node.js", - "repository": "googleapis/nodejs-channel", - "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 reports service", - "cloud channel service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "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": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.2" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.62", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto deleted file mode 100644 index d0607af278c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/channel_partner_links.proto +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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]; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto deleted file mode 100644 index 2380722ac8d..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/common.proto +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto deleted file mode 100644 index 18bf1ad99a1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/customers.proto +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto deleted file mode 100644 index 8a6633b140c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/entitlements.proto +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto deleted file mode 100644 index 3a504045350..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/offers.proto +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto deleted file mode 100644 index e9e190772cb..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/operations.proto +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto deleted file mode 100644 index 411e1698b96..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/products.proto +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto deleted file mode 100644 index 1cb87124cb6..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/reports_service.proto +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto deleted file mode 100644 index 1a15067b378..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/repricing.proto +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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]; - - // The conditional overrides to apply for this configuration. If you list - // multiple overrides, only the first valid override is used. If you don't - // list any overrides, the API uses the normal adjustment and rebilling basis. - repeated ConditionalOverride conditional_overrides = 6; -} - -// 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; -} - -// Specifies the override to conditionally apply. -message ConditionalOverride { - // Required. Information about the applied override's adjustment. - RepricingAdjustment adjustment = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to - // use for the applied override. Shows the relative cost based on your - // repricing costs. - RebillingBasis rebilling_basis = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specifies the condition which, if met, will apply the override. - RepricingCondition repricing_condition = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Represents the various repricing conditions you can use for a conditional -// override. -message RepricingCondition { - // Represents the types of existing conditional statements. - oneof condition { - // SKU Group condition for override. - SkuGroupCondition sku_group_condition = 1; - } -} - -// A condition that applies the override if a line item SKU is found in the SKU -// group. -message SkuGroupCondition { - // Specifies a SKU group (https://cloud.google.com/skus/sku-groups). - // Resource name of SKU group. Format: - // accounts/{account}/skuGroups/{sku_group}. - // Example: - // "accounts/C01234/skuGroups/3d50fd57-3157-4577-a5a9-a219b8490041". - string sku_group = 1; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto deleted file mode 100644 index 93730e9ea33..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/service.proto +++ /dev/null @@ -1,2635 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto b/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto deleted file mode 100644 index 0135c066f44..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/protos/google/cloud/channel/v1/subscriber_event.proto +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.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; - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js deleted file mode 100644 index 38703fe5671..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js deleted file mode 100644 index 56b561b5f62..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.list_reports.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js deleted file mode 100644 index 6f1866707ea..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_reports_service.run_report_job.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js deleted file mode 100644 index 18b3c57f4af..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.activate_entitlement.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js deleted file mode 100644 index 4f89a80116b..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.cancel_entitlement.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js deleted file mode 100644 index 2442ce2baad..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_offer.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js deleted file mode 100644 index b4ac8bb935f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_parameters.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js deleted file mode 100644 index a4f56944cbc..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.change_renewal_settings.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js deleted file mode 100644 index c519611c960..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js deleted file mode 100644 index 29afadcf520..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js deleted file mode 100644 index ebddea882f0..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js deleted file mode 100644 index 869f222ba01..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js deleted file mode 100644 index 826bdced548..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js deleted file mode 100644 index b8659127c46..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.create_entitlement.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js deleted file mode 100644 index 6cc8d7d7392..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js deleted file mode 100644 index b4c54c9a8b7..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js deleted file mode 100644 index 3722b11cbe5..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js deleted file mode 100644 index dc136c38aa5..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js deleted file mode 100644 index 77803006a9d..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js deleted file mode 100644 index 7c9be5abcbe..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js deleted file mode 100644 index dff81702966..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js deleted file mode 100644 index b9ed504c2c6..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.get_entitlement.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js deleted file mode 100644 index 790f8400f92..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.import_customer.js +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js deleted file mode 100644 index f15c6488eff..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js deleted file mode 100644 index 67ae5544814..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js deleted file mode 100644 index 147c7372d0c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js deleted file mode 100644 index c31b53e38ae..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_customers.js +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js deleted file mode 100644 index 3f8141a1ab0..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_entitlements.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js deleted file mode 100644 index 2d5aa523628..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_offers.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js deleted file mode 100644 index d48a6ed20ec..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_products.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js deleted file mode 100644 index ce69e278509..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js deleted file mode 100644 index bb6bb21c485..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js deleted file mode 100644 index f7c1a1984f1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_skus.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js deleted file mode 100644 index 42416cf9bde..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_subscribers.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js deleted file mode 100644 index c4f6fb76c93..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_offers.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js deleted file mode 100644 index 5aa3ba3c98a..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.list_transferable_skus.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js deleted file mode 100644 index 43c97a05551..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.lookup_offer.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js deleted file mode 100644 index 81b8b0a0ad2..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js deleted file mode 100644 index 027099cf1b5..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.register_subscriber.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js deleted file mode 100644 index d6989b2956f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.start_paid_service.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js deleted file mode 100644 index f908473d2ee..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.suspend_entitlement.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js deleted file mode 100644 index f898044ffca..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js deleted file mode 100644 index f28efb36e02..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js deleted file mode 100644 index 2055f05d52c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.unregister_subscriber.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js deleted file mode 100644 index e28cd686492..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js deleted file mode 100644 index 6dfb5c06606..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js deleted file mode 100644 index fb7ed485b06..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js deleted file mode 100644 index becdd61604c..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file 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/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json b/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json deleted file mode 100644 index 75499244799..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json +++ /dev/null @@ -1,2323 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-channel", - "version": "0.1.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": 75, - "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": 78, - "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": 78, - "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": 92, - "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": 72, - "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": 97, - "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": 90, - "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": 74, - "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": 82, - "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": 74, - "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": 86, - "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": 69, - "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": 69, - "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": 69, - "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": 69, - "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": 81, - "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": 74, - "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": 75, - "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": 82, - "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": 60, - "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": 86, - "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": 54, - "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": 59, - "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": 59, - "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" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-channel/v1/src/index.ts b/owl-bot-staging/google-cloud-channel/v1/src/index.ts deleted file mode 100644 index 40ff077679f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts deleted file mode 100644 index 10534d8a429..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client.ts +++ /dev/null @@ -1,1515 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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.longrunning.IOperation|undefined, {}|undefined - ]>; - runReportJob( - request: protos.google.cloud.channel.v1.IRunReportJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runReportJob( - request: protos.google.cloud.channel.v1.IRunReportJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - runReportJob( - request?: protos.google.cloud.channel.v1.IRunReportJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } - /** - * 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json deleted file mode 100644 index c3db1fd9619..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json deleted file mode 100644 index aff1dcc4ca3..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_reports_service_proto_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "../../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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts deleted file mode 100644 index 56becdcf56f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client.ts +++ /dev/null @@ -1,7419 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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.longrunning.IOperation|undefined, {}|undefined - ]>; - provisionCloudIdentity( - request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - provisionCloudIdentity( - request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - provisionCloudIdentity( - request?: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - createEntitlement( - request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntitlement( - request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEntitlement( - request?: protos.google.cloud.channel.v1.ICreateEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - changeParameters( - request: protos.google.cloud.channel.v1.IChangeParametersRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeParameters( - request: protos.google.cloud.channel.v1.IChangeParametersRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeParameters( - request?: protos.google.cloud.channel.v1.IChangeParametersRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - changeRenewalSettings( - request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeRenewalSettings( - request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeRenewalSettings( - request?: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - changeOffer( - request: protos.google.cloud.channel.v1.IChangeOfferRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeOffer( - request: protos.google.cloud.channel.v1.IChangeOfferRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - changeOffer( - request?: protos.google.cloud.channel.v1.IChangeOfferRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - startPaidService( - request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startPaidService( - request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startPaidService( - request?: protos.google.cloud.channel.v1.IStartPaidServiceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - suspendEntitlement( - request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suspendEntitlement( - request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - suspendEntitlement( - request?: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - cancelEntitlement( - request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelEntitlement( - request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelEntitlement( - request?: protos.google.cloud.channel.v1.ICancelEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - activateEntitlement( - request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - activateEntitlement( - request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - activateEntitlement( - request?: protos.google.cloud.channel.v1.IActivateEntitlementRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - '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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - transferEntitlements( - request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlements( - request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlements( - request?: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.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>{ - 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; - } -/** - * 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.longrunning.IOperation|undefined, {}|undefined - ]>; - transferEntitlementsToGoogle( - request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlementsToGoogle( - request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - transferEntitlementsToGoogle( - request?: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.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>{ - 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; - } - /** - * 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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json deleted file mode 100644 index 625117c33e1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_client_config.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json deleted file mode 100644 index aff1dcc4ca3..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/cloud_channel_service_proto_list.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - "../../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/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json deleted file mode 100644 index ae5f1241294..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,577 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts deleted file mode 100644 index 503f298a0d2..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/src/v1/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 00977d9b464..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 730a061ac94..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts b/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts deleted file mode 100644 index 557a57558e1..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts deleted file mode 100644 index 1dfadbbe14f..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_reports_service_v1.ts +++ /dev/null @@ -1,1511 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts b/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts deleted file mode 100644 index f7d4a0ccdec..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/test/gapic_cloud_channel_service_v1.ts +++ /dev/null @@ -1,7940 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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/owl-bot-staging/google-cloud-channel/v1/tsconfig.json b/owl-bot-staging/google-cloud-channel/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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/owl-bot-staging/google-cloud-channel/v1/webpack.config.js b/owl-bot-staging/google-cloud-channel/v1/webpack.config.js deleted file mode 100644 index 8d1a69f3594..00000000000 --- a/owl-bot-staging/google-cloud-channel/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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/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 index fb301586ea8..d0607af278c 100644 --- 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 @@ -26,7 +26,9 @@ 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. +// 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. @@ -72,24 +74,29 @@ message ChannelPartnerLink { 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]; + 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]; + 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]; + 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]; + 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. + // 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]; -} + CloudIdentityInfo channel_partner_cloud_identity_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} \ No newline at end of file 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 index 175d044e63b..2380722ac8d 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto @@ -149,4 +149,4 @@ message AdminUser { // Family name of the admin user. string family_name = 3; -} +} \ No newline at end of file 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 index e34432f2e67..18bf1ad99a1 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto @@ -45,7 +45,8 @@ message Customer { // 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]; + google.type.PostalAddress org_postal_address = 3 + [(google.api.field_behavior) = REQUIRED]; // Primary contact info. ContactInfo primary_contact_info = 4; @@ -62,10 +63,12 @@ message Customer { 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]; + 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]; + 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. @@ -78,7 +81,8 @@ message Customer { // 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]; + 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. @@ -107,4 +111,4 @@ message ContactInfo { // The customer account's contact phone number. string phone = 7; -} +} \ No newline at end of file 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 index 35da239384e..8a6633b140c 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto @@ -47,7 +47,9 @@ message Entitlement { SUSPENDED = 5; } - // Suspension reason for an entitlement if [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] = SUSPENDED. + // Suspension reason for an entitlement if + // [provisioning_state][google.cloud.channel.v1.Entitlement.provisioning_state] + // = SUSPENDED. enum SuspensionReason { // Not used. SUSPENSION_REASON_UNSPECIFIED = 0; @@ -74,10 +76,12 @@ message Entitlement { 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]; + 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]; + 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}. @@ -93,19 +97,23 @@ message Entitlement { CommitmentSettings commitment_settings = 12; // Output only. Current provisioning state of the entitlement. - ProvisioningState provisioning_state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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. + 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. @@ -136,9 +144,9 @@ message Parameter { // 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. + // 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]; } @@ -146,32 +154,35 @@ message Parameter { 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" - }]; + 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 + // 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. + // 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. + // 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]; + 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]; + 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]; @@ -218,7 +229,8 @@ message TransferableSku { // 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. + // Optional. The customer to transfer has an entitlement with the populated + // legacy SKU. Sku legacy_sku = 12 [(google.api.field_behavior) = OPTIONAL]; } @@ -247,4 +259,4 @@ message TransferEligibility { // Specified the reason for ineligibility. Reason ineligibility_reason = 3; -} +} \ No newline at end of file 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 index ebe698e1f54..3a504045350 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto @@ -125,8 +125,8 @@ enum PeriodType { } // 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. +// 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" @@ -156,7 +156,8 @@ message Offer { 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]; + 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; @@ -326,4 +327,4 @@ message Period { // Period Type. PeriodType period_type = 2; -} +} \ No newline at end of file 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 index ad432919bf7..e9e190772cb 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto @@ -21,7 +21,8 @@ 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]. +// Provides contextual information about a +// [google.longrunning.Operation][google.longrunning.Operation]. message OperationMetadata { // RPCs that return a Long Running Operation. enum OperationType { @@ -64,4 +65,4 @@ message OperationMetadata { // The RPC that initiated this Long Running Operation. OperationType operation_type = 1; -} +} \ No newline at end of file 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 index 8dc39767a96..411e1698b96 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto @@ -91,4 +91,4 @@ message Media { // Type of the media. MediaType type = 3; -} +} \ No newline at end of file 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 index 464061766cf..1cb87124cb6 100644 --- 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 @@ -38,7 +38,8 @@ option java_package = "com.google.cloud.channel.v1"; // 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"; + 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`). @@ -62,7 +63,8 @@ service CloudChannelReportsService { // 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 + // [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) = { @@ -75,8 +77,10 @@ service CloudChannelReportsService { }; } - // Retrieves data generated by [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. - rpc FetchReportResults(FetchReportResultsRequest) returns (FetchReportResultsResponse) { + // 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: "*" @@ -94,10 +98,11 @@ service CloudChannelReportsService { } } -// Request message for [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. +// 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, + // 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} @@ -111,8 +116,8 @@ message RunReportJobRequest { // 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. + // 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. @@ -130,9 +135,11 @@ message RunReportJobRequest { string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob]. +// 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] + // 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; @@ -142,9 +149,11 @@ message RunReportJobResponse { ReportResultsMetadata report_metadata = 2; } -// Request message for [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. +// 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]. + // 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 [ @@ -154,9 +163,9 @@ message FetchReportResultsRequest { } ]; - // 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). + // 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. @@ -164,12 +173,15 @@ message FetchReportResultsRequest { // 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. + // [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]. +// 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 @@ -180,27 +192,30 @@ message FetchReportResultsResponse { // 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. + // 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]. +// 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} + // 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. + // 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. + // [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 @@ -210,18 +225,21 @@ message ListReportsRequest { string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelReportsService.ListReports][google.cloud.channel.v1.CloudChannelReportsService.ListReports]. +// 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. + // 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. +// [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" @@ -238,7 +256,8 @@ message ReportJob { } // The features describing the data. Returned by -// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob] and +// [CloudChannelReportsService.RunReportJob][google.cloud.channel.v1.CloudChannelReportsService.RunReportJob] +// and // [CloudChannelReportsService.FetchReportResults][google.cloud.channel.v1.CloudChannelReportsService.FetchReportResults]. message ReportResultsMetadata { // Details of the completed report. @@ -404,9 +423,9 @@ message 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`). + // 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} @@ -422,4 +441,4 @@ message Report { // A description of other aspects of the report, such as the products // it supports. string description = 4; -} +} \ No newline at end of file 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 index 7cc2f26072c..1a15067b378 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto @@ -54,14 +54,16 @@ message CustomerRepricingConfig { // 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. + // 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]; + // 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 @@ -77,14 +79,16 @@ message ChannelPartnerRepricingConfig { // 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. + // 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]; + // 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. @@ -95,16 +99,14 @@ message RepricingConfig { // Format: // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} string entitlement = 1 [(google.api.resource_reference) = { - type: "cloudchannel.googleapis.com/Entitlement" - }]; + 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 { - - } + message ChannelPartnerGranularity {} // Required. Defines the granularity for repricing. oneof granularity { @@ -117,16 +119,23 @@ message RepricingConfig { 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. 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. + // 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]; + + // The conditional overrides to apply for this configuration. If you list + // multiple overrides, only the first valid override is used. If you don't + // list any overrides, the API uses the normal adjustment and rebilling basis. + repeated ConditionalOverride conditional_overrides = 6; } // A type that represents the various adjustments you can apply to a bill. @@ -147,3 +156,39 @@ message PercentageAdjustment { // Pass-Through => "0.00" google.type.Decimal percentage = 2; } + +// Specifies the override to conditionally apply. +message ConditionalOverride { + // Required. Information about the applied override's adjustment. + RepricingAdjustment adjustment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to + // use for the applied override. Shows the relative cost based on your + // repricing costs. + RebillingBasis rebilling_basis = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the condition which, if met, will apply the override. + RepricingCondition repricing_condition = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the various repricing conditions you can use for a conditional +// override. +message RepricingCondition { + // Represents the types of existing conditional statements. + oneof condition { + // SKU Group condition for override. + SkuGroupCondition sku_group_condition = 1; + } +} + +// A condition that applies the override if a line item SKU is found in the SKU +// group. +message SkuGroupCondition { + // Specifies a SKU group (https://cloud.google.com/skus/sku-groups). + // Resource name of SKU group. Format: + // accounts/{account}/skuGroups/{sku_group}. + // Example: + // "accounts/C01234/skuGroups/3d50fd57-3157-4577-a5a9-a219b8490041". + string sku_group = 1; +} \ No newline at end of file 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 index bbb092e181f..93730e9ea33 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto @@ -46,18 +46,20 @@ option java_package = "com.google.cloud.channel.v1"; // 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. +// - [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. +// - [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. +// - [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"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/apps.order"; // List [Customer][google.cloud.channel.v1.Customer]s. // @@ -68,7 +70,8 @@ service CloudChannelService { // * 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. + // 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" @@ -78,7 +81,8 @@ service CloudChannelService { }; } - // Returns the requested [Customer][google.cloud.channel.v1.Customer] resource. + // Returns the requested [Customer][google.cloud.channel.v1.Customer] + // resource. // // Possible error codes: // @@ -111,20 +115,24 @@ service CloudChannelService { // * 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) + // 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) { + // 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. + // Creates a new [Customer][google.cloud.channel.v1.Customer] resource under + // the reseller or distributor account. // // Possible error codes: // @@ -147,15 +155,16 @@ service CloudChannelService { }; } - // Updates an existing [Customer][google.cloud.channel.v1.Customer] resource for the reseller or - // distributor. + // 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. + // * 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. @@ -178,7 +187,8 @@ service CloudChannelService { // 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. + // * 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/*}" @@ -189,10 +199,10 @@ service CloudChannelService { 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. + // 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: // @@ -238,7 +248,8 @@ service CloudChannelService { // 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) { + rpc ProvisionCloudIdentity(ProvisionCloudIdentityRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{customer=accounts/*/customers/*}:provisionCloudIdentity" body: "*" @@ -249,7 +260,8 @@ service CloudChannelService { }; } - // Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. + // Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a + // customer. // // Possible error codes: // @@ -257,15 +269,17 @@ service CloudChannelService { // * 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) { + // 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. + // 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 @@ -281,16 +295,18 @@ service CloudChannelService { // * 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) { + // 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. + // 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 @@ -307,15 +323,18 @@ service CloudChannelService { // * 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) { + // 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. + // Returns the requested [Entitlement][google.cloud.channel.v1.Entitlement] + // resource. // // Possible error codes: // @@ -367,7 +386,8 @@ service CloudChannelService { // 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) { + rpc CreateEntitlement(CreateEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=accounts/*/customers/*}/entitlements" body: "*" @@ -401,7 +421,8 @@ service CloudChannelService { // 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) { + rpc ChangeParameters(ChangeParametersRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeParameters" body: "*" @@ -435,7 +456,8 @@ service CloudChannelService { // 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) { + rpc ChangeRenewalSettings(ChangeRenewalSettingsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:changeRenewalSettings" body: "*" @@ -502,7 +524,8 @@ service CloudChannelService { // 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) { + rpc StartPaidService(StartPaidServiceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:startPaidService" body: "*" @@ -534,7 +557,8 @@ service CloudChannelService { // 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) { + rpc SuspendEntitlement(SuspendEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:suspend" body: "*" @@ -571,7 +595,8 @@ service CloudChannelService { // 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) { + rpc CancelEntitlement(CancelEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:cancel" body: "*" @@ -609,7 +634,8 @@ service CloudChannelService { // 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) { + rpc ActivateEntitlement(ActivateEntitlementRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=accounts/*/customers/*/entitlements/*}:activate" body: "*" @@ -649,7 +675,8 @@ service CloudChannelService { // 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) { + rpc TransferEntitlements(TransferEntitlementsRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=accounts/*/customers/*}:transferEntitlements" body: "*" @@ -689,7 +716,8 @@ service CloudChannelService { // 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) { + rpc TransferEntitlementsToGoogle(TransferEntitlementsToGoogleRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=accounts/*/customers/*}:transferEntitlementsToGoogle" body: "*" @@ -700,8 +728,8 @@ service CloudChannelService { }; } - // List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s belonging to a distributor. - // You must be a distributor to call this method. + // List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s + // belonging to a distributor. You must be a distributor to call this method. // // Possible error codes: // @@ -710,14 +738,17 @@ service CloudChannelService { // * 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) { + // 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. + // Returns the requested + // [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. // You must be a distributor to call this method. // // Possible error codes: @@ -729,8 +760,10 @@ service CloudChannelService { // invalid channel partner link name. // // Return value: - // The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. - rpc GetChannelPartnerLink(GetChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + // The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] + // resource. + rpc GetChannelPartnerLink(GetChannelPartnerLinkRequest) + returns (ChannelPartnerLink) { option (google.api.http) = { get: "/v1/{name=accounts/*/channelPartnerLinks/*}" }; @@ -757,8 +790,10 @@ service CloudChannelService { // Contact Cloud Channel support. // // Return value: - // The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. - rpc CreateChannelPartnerLink(CreateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + // 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" @@ -785,8 +820,10 @@ service CloudChannelService { // Contact Cloud Channel support. // // Return value: - // The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. - rpc UpdateChannelPartnerLink(UpdateChannelPartnerLinkRequest) returns (ChannelPartnerLink) { + // The updated + // [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + rpc UpdateChannelPartnerLink(UpdateChannelPartnerLinkRequest) + returns (ChannelPartnerLink) { option (google.api.http) = { patch: "/v1/{name=accounts/*/channelPartnerLinks/*}" body: "*" @@ -800,14 +837,18 @@ service CloudChannelService { // // * 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. + // * 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) { + // 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/*}" }; @@ -821,21 +862,25 @@ service CloudChannelService { // // * 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. + // * 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: + // 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) { + rpc ListCustomerRepricingConfigs(ListCustomerRepricingConfigsRequest) + returns (ListCustomerRepricingConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=accounts/*/customers/*}/customerRepricingConfigs" }; @@ -844,9 +889,9 @@ service CloudChannelService { // 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. + // [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 @@ -860,9 +905,11 @@ service CloudChannelService { // 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 + // 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: @@ -872,15 +919,18 @@ service CloudChannelService { // * 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. + // * 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) { + // 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" @@ -893,10 +943,11 @@ service CloudChannelService { // 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]. + // [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: // @@ -909,15 +960,18 @@ service CloudChannelService { // * 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. + // * 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) { + // 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" @@ -925,20 +979,25 @@ service CloudChannelService { 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. + // 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) { + // * 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/*}" }; @@ -952,14 +1011,18 @@ service CloudChannelService { // // * 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. + // * 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) { + // 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/*}" }; @@ -973,20 +1036,25 @@ service CloudChannelService { // // * 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. + // * 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: + // 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) { + rpc ListChannelPartnerRepricingConfigs( + ListChannelPartnerRepricingConfigsRequest) + returns (ListChannelPartnerRepricingConfigsResponse) { option (google.api.http) = { get: "/v1/{parent=accounts/*/channelPartnerLinks/*}/channelPartnerRepricingConfigs" }; @@ -995,9 +1063,10 @@ service CloudChannelService { // 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. + // 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 @@ -1011,8 +1080,9 @@ service CloudChannelService { // 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 + // * 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: @@ -1022,20 +1092,25 @@ service CloudChannelService { // * 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. + // * 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) { + // 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"; + option (google.api.method_signature) = + "parent,channel_partner_repricing_config"; } // Updates a ChannelPartnerRepricingConfig. Call this method to set @@ -1043,10 +1118,11 @@ service CloudChannelService { // 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]. + // [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: // @@ -1059,15 +1135,19 @@ service CloudChannelService { // * 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. + // * 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) { + // 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" @@ -1075,20 +1155,26 @@ service CloudChannelService { 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. + // 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) { + // * 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/*}" }; @@ -1153,7 +1239,8 @@ service CloudChannelService { // // * PERMISSION_DENIED: The customer doesn't belong to the reseller. // * INVALID_ARGUMENT: Required request parameters are missing or invalid. - rpc ListPurchasableSkus(ListPurchasableSkusRequest) returns (ListPurchasableSkusResponse) { + rpc ListPurchasableSkus(ListPurchasableSkusRequest) + returns (ListPurchasableSkusResponse) { option (google.api.http) = { get: "/v1/{customer=accounts/*/customers/*}:listPurchasableSkus" }; @@ -1168,7 +1255,8 @@ service CloudChannelService { // // * PERMISSION_DENIED: The customer doesn't belong to the reseller // * INVALID_ARGUMENT: Required request parameters are missing or invalid. - rpc ListPurchasableOffers(ListPurchasableOffersRequest) returns (ListPurchasableOffersResponse) { + rpc ListPurchasableOffers(ListPurchasableOffersRequest) + returns (ListPurchasableOffersResponse) { option (google.api.http) = { get: "/v1/{customer=accounts/*/customers/*}:listPurchasableOffers" }; @@ -1176,7 +1264,8 @@ service CloudChannelService { // 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] + // subscriber, you get the events through + // [SubscriberEvent][google.cloud.channel.v1.SubscriberEvent] // // Possible error codes: // @@ -1191,7 +1280,8 @@ service CloudChannelService { // // Return value: // The topic name with the registered service email address. - rpc RegisterSubscriber(RegisterSubscriberRequest) returns (RegisterSubscriberResponse) { + rpc RegisterSubscriber(RegisterSubscriberRequest) + returns (RegisterSubscriberResponse) { option (google.api.http) = { post: "/v1/{account=accounts/*}:register" body: "*" @@ -1219,7 +1309,8 @@ service CloudChannelService { // 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) { + rpc UnregisterSubscriber(UnregisterSubscriberRequest) + returns (UnregisterSubscriberResponse) { option (google.api.http) = { post: "/v1/{account=accounts/*}:unregister" body: "*" @@ -1243,14 +1334,16 @@ service CloudChannelService { // // Return value: // A list of service email addresses. - rpc ListSubscribers(ListSubscribersRequest) returns (ListSubscribersResponse) { + 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]. +// 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} @@ -1287,40 +1380,48 @@ message CheckCloudIdentityAccountsExistResponse { repeated CloudIdentityCustomerAccount cloud_identity_accounts = 1; } -// Request message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] +// 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 + // 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. + // [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 + // 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]. +// 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. + // 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]. +// 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} @@ -1332,17 +1433,19 @@ message GetCustomerRequest { ]; } -// Request message for [CloudChannelService.CreateCustomer][google.cloud.channel.v1.CloudChannelService.CreateCustomer] +// 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} + // 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]. +// 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]; @@ -1352,7 +1455,8 @@ message UpdateCustomerRequest { google.protobuf.FieldMask update_mask = 3; } -// Request message for [CloudChannelService.DeleteCustomer][google.cloud.channel.v1.CloudChannelService.DeleteCustomer]. +// 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 [ @@ -1363,7 +1467,8 @@ message DeleteCustomerRequest { ]; } -// Request message for [CloudChannelService.ImportCustomer][google.cloud.channel.v1.CloudChannelService.ImportCustomer] +// 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 @@ -1393,9 +1498,10 @@ message ImportCustomerRequest { // 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. + // 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 @@ -1409,7 +1515,8 @@ message ImportCustomerRequest { ]; } -// Request message for [CloudChannelService.ProvisionCloudIdentity][google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity] +// 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} @@ -1430,7 +1537,8 @@ message ProvisionCloudIdentityRequest { bool validate_only = 4; } -// Request message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] +// 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. @@ -1442,29 +1550,35 @@ message ListEntitlementsRequest { } ]; - // 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. + // 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. + // [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]. +// 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. + // 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] +// 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 @@ -1492,9 +1606,10 @@ message ListTransferableSkusRequest { // 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. + // [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 @@ -1510,18 +1625,21 @@ message ListTransferableSkusRequest { string language_code = 6; } -// Response message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus]. +// 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. + // 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] +// 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 @@ -1545,8 +1663,10 @@ message ListTransferableOffersRequest { // 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. + // [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. @@ -1558,15 +1678,17 @@ message ListTransferableOffersRequest { string language_code = 7 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers]. +// 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. + // Pass to + // [ListTransferableOffersRequest.page_token][google.cloud.channel.v1.ListTransferableOffersRequest.page_token] + // to obtain that page. string next_page_token = 2; } @@ -1577,7 +1699,8 @@ message TransferableOffer { Offer offer = 1; } -// Request message for [CloudChannelService.GetEntitlement][google.cloud.channel.v1.CloudChannelService.GetEntitlement]. +// 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: @@ -1590,39 +1713,45 @@ message GetEntitlementRequest { ]; } -// Request message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] +// 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} + // 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. + // 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. + // [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]. +// 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. + // 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]. +// 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} @@ -1633,7 +1762,8 @@ message GetChannelPartnerLinkRequest { ChannelPartnerLinkView view = 2 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.CreateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink] +// 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. @@ -1643,27 +1773,32 @@ message CreateChannelPartnerLinkRequest { // 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]; + ChannelPartnerLink channel_partner_link = 2 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.UpdateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink] +// 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 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]; + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.GetCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig]. +// Request message for +// [CloudChannelService.GetCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetCustomerRepricingConfig]. message GetCustomerRepricingConfigRequest { // Required. The resource name of the CustomerRepricingConfig. // Format: @@ -1676,7 +1811,8 @@ message GetCustomerRepricingConfigRequest { ]; } -// Request message for [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs]. +// 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}. @@ -1689,15 +1825,17 @@ message ListCustomerRepricingConfigsRequest { } ]; - // 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. + // 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. + // [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] @@ -1710,21 +1848,25 @@ message ListCustomerRepricingConfigsRequest { string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs]. +// 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. + // 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]. +// 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} + // 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) = { @@ -1733,19 +1875,23 @@ message CreateCustomerRepricingConfigRequest { ]; // Required. The CustomerRepricingConfig object to update. - CustomerRepricingConfig customer_repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; + CustomerRepricingConfig customer_repricing_config = 2 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.UpdateCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.UpdateCustomerRepricingConfig]. +// 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]; + CustomerRepricingConfig customer_repricing_config = 1 + [(google.api.field_behavior) = REQUIRED]; } -// Request message for [CloudChannelService.DeleteCustomerRepricingConfig][google.cloud.channel.v1.CloudChannelService.DeleteCustomerRepricingConfig]. +// 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: + // 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, @@ -1755,7 +1901,8 @@ message DeleteCustomerRepricingConfigRequest { ]; } -// Request message for [CloudChannelService.GetChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig] +// Request message for +// [CloudChannelService.GetChannelPartnerRepricingConfig][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerRepricingConfig] message GetChannelPartnerRepricingConfigRequest { // Required. The resource name of the ChannelPartnerRepricingConfig // Format: @@ -1771,8 +1918,9 @@ message GetChannelPartnerRepricingConfigRequest { // 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: + // 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. @@ -1783,21 +1931,23 @@ message ListChannelPartnerRepricingConfigsRequest { } ]; - // 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. + // 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. + // [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 + // 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 = @@ -1813,16 +1963,17 @@ message ListChannelPartnerRepricingConfigsResponse { 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. + // 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: + // 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, @@ -1832,19 +1983,22 @@ message CreateChannelPartnerRepricingConfigRequest { ]; // Required. The ChannelPartnerRepricingConfig object to update. - ChannelPartnerRepricingConfig channel_partner_repricing_config = 2 [(google.api.field_behavior) = REQUIRED]; + 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]; + 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. + // 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) = { @@ -1853,11 +2007,12 @@ message DeleteChannelPartnerRepricingConfigRequest { ]; } -// Request message for [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement] +// 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} + // 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) = { @@ -1868,8 +2023,9 @@ message CreateEntitlementRequest { // 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. + // 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 @@ -1882,15 +2038,17 @@ message CreateEntitlementRequest { string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +// 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} + // 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]; + 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 @@ -1898,8 +2056,9 @@ message TransferEntitlementsRequest { // 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. + // 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 @@ -1912,25 +2071,29 @@ message TransferEntitlementsRequest { string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. +// 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]. +// 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} + // 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]; + 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. + // 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 @@ -1950,14 +2113,17 @@ message ChangeParametersRequest { // 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. + // 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. + // [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. + // 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 @@ -1973,7 +2139,8 @@ message ChangeParametersRequest { string purchase_order_id = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.ChangeRenewalSettings][google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings]. +// 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: @@ -1983,8 +2150,9 @@ message ChangeRenewalSettingsRequest { // 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. + // 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 @@ -1997,7 +2165,8 @@ message ChangeRenewalSettingsRequest { string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. +// 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: @@ -2013,15 +2182,18 @@ message ChangeOfferRequest { } ]; - // 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. + // 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. + // 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 @@ -2034,15 +2206,17 @@ message ChangeOfferRequest { string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.StartPaidService][google.cloud.channel.v1.CloudChannelService.StartPaidService]. +// 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. + // 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 @@ -2055,15 +2229,17 @@ message StartPaidServiceRequest { string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.CancelEntitlement][google.cloud.channel.v1.CloudChannelService.CancelEntitlement]. +// 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. + // 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 @@ -2076,15 +2252,17 @@ message CancelEntitlementRequest { string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.SuspendEntitlement][google.cloud.channel.v1.CloudChannelService.SuspendEntitlement]. +// 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. + // 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 @@ -2097,15 +2275,17 @@ message SuspendEntitlementRequest { string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for [CloudChannelService.ActivateEntitlement][google.cloud.channel.v1.CloudChannelService.ActivateEntitlement]. +// 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. + // 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 @@ -2137,9 +2317,9 @@ message ListProductsRequest { // 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. + // 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. @@ -2176,9 +2356,9 @@ message ListSkusRequest { // 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. + // 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. @@ -2202,13 +2382,13 @@ message ListSkusResponse { // 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}. + // 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. + // 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. @@ -2248,7 +2428,8 @@ message ListPurchasableSkusRequest { } // List SKUs for upgrading or downgrading an entitlement. Make the purchase - // using [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. + // using + // [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. message ChangeOfferPurchase { // Change Type enum. enum ChangeType { @@ -2289,9 +2470,9 @@ message ListPurchasableSkusRequest { } ]; - // 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. + // 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. @@ -2359,9 +2540,9 @@ message ListPurchasableOffersRequest { } ]; - // 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. + // 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. @@ -2394,7 +2575,8 @@ 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. + // Required. Service account that provides subscriber access to the registered + // topic. string service_account = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -2409,7 +2591,8 @@ 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. + // Required. Service account to unregister from subscriber access to the + // topic. string service_account = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -2424,10 +2607,10 @@ 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. + // 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. @@ -2449,4 +2632,4 @@ message ListSubscribersResponse { // 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; -} +} \ No newline at end of file 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 index 3c67216ed65..0135c066f44 100644 --- 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 @@ -40,8 +40,8 @@ message CustomerEvent { // 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: "cloudchannel.googleapis.com/Customer" + }]; // Type of event which happened on the customer. Type event_type = 2; @@ -97,8 +97,8 @@ message EntitlementEvent { // 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: "cloudchannel.googleapis.com/Entitlement" + }]; // Type of event which happened on the entitlement. Type event_type = 2; @@ -116,4 +116,4 @@ message SubscriberEvent { // Entitlement event sent as part of Pub/Sub event to partners. EntitlementEvent entitlement_event = 2; } -} +} \ No newline at end of file diff --git a/packages/google-cloud-channel/protos/protos.d.ts b/packages/google-cloud-channel/protos/protos.d.ts index 7d3c465c6f1..f3029af8a6c 100644 --- a/packages/google-cloud-channel/protos/protos.d.ts +++ b/packages/google-cloud-channel/protos/protos.d.ts @@ -5710,6 +5710,9 @@ export namespace google { /** RepricingConfig rebillingBasis */ rebillingBasis?: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis|null); + + /** RepricingConfig conditionalOverrides */ + conditionalOverrides?: (google.cloud.channel.v1.IConditionalOverride[]|null); } /** Represents a RepricingConfig. */ @@ -5736,6 +5739,9 @@ export namespace google { /** RepricingConfig rebillingBasis. */ public rebillingBasis: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis); + /** RepricingConfig conditionalOverrides. */ + public conditionalOverrides: google.cloud.channel.v1.IConditionalOverride[]; + /** RepricingConfig granularity. */ public granularity?: ("entitlementGranularity"|"channelPartnerGranularity"); @@ -6205,6 +6211,312 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ConditionalOverride. */ + interface IConditionalOverride { + + /** ConditionalOverride adjustment */ + adjustment?: (google.cloud.channel.v1.IRepricingAdjustment|null); + + /** ConditionalOverride rebillingBasis */ + rebillingBasis?: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis|null); + + /** ConditionalOverride repricingCondition */ + repricingCondition?: (google.cloud.channel.v1.IRepricingCondition|null); + } + + /** Represents a ConditionalOverride. */ + class ConditionalOverride implements IConditionalOverride { + + /** + * Constructs a new ConditionalOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IConditionalOverride); + + /** ConditionalOverride adjustment. */ + public adjustment?: (google.cloud.channel.v1.IRepricingAdjustment|null); + + /** ConditionalOverride rebillingBasis. */ + public rebillingBasis: (google.cloud.channel.v1.RebillingBasis|keyof typeof google.cloud.channel.v1.RebillingBasis); + + /** ConditionalOverride repricingCondition. */ + public repricingCondition?: (google.cloud.channel.v1.IRepricingCondition|null); + + /** + * Creates a new ConditionalOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionalOverride instance + */ + public static create(properties?: google.cloud.channel.v1.IConditionalOverride): google.cloud.channel.v1.ConditionalOverride; + + /** + * Encodes the specified ConditionalOverride message. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @param message ConditionalOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IConditionalOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionalOverride message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @param message ConditionalOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IConditionalOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionalOverride + * @throws {Error} If the payload is not a 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.ConditionalOverride; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionalOverride + * @throws {Error} If the payload is 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.ConditionalOverride; + + /** + * Verifies a ConditionalOverride message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionalOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionalOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.ConditionalOverride; + + /** + * Creates a plain object from a ConditionalOverride message. Also converts values to other types if specified. + * @param message ConditionalOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.ConditionalOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionalOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionalOverride + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RepricingCondition. */ + interface IRepricingCondition { + + /** RepricingCondition skuGroupCondition */ + skuGroupCondition?: (google.cloud.channel.v1.ISkuGroupCondition|null); + } + + /** Represents a RepricingCondition. */ + class RepricingCondition implements IRepricingCondition { + + /** + * Constructs a new RepricingCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IRepricingCondition); + + /** RepricingCondition skuGroupCondition. */ + public skuGroupCondition?: (google.cloud.channel.v1.ISkuGroupCondition|null); + + /** RepricingCondition condition. */ + public condition?: "skuGroupCondition"; + + /** + * Creates a new RepricingCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns RepricingCondition instance + */ + public static create(properties?: google.cloud.channel.v1.IRepricingCondition): google.cloud.channel.v1.RepricingCondition; + + /** + * Encodes the specified RepricingCondition message. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @param message RepricingCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IRepricingCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepricingCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @param message RepricingCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IRepricingCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepricingCondition + * @throws {Error} If the payload is not a 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.RepricingCondition; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepricingCondition + * @throws {Error} If the payload is 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.RepricingCondition; + + /** + * Verifies a RepricingCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepricingCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepricingCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.RepricingCondition; + + /** + * Creates a plain object from a RepricingCondition message. Also converts values to other types if specified. + * @param message RepricingCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.RepricingCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepricingCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepricingCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SkuGroupCondition. */ + interface ISkuGroupCondition { + + /** SkuGroupCondition skuGroup */ + skuGroup?: (string|null); + } + + /** Represents a SkuGroupCondition. */ + class SkuGroupCondition implements ISkuGroupCondition { + + /** + * Constructs a new SkuGroupCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ISkuGroupCondition); + + /** SkuGroupCondition skuGroup. */ + public skuGroup: string; + + /** + * Creates a new SkuGroupCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns SkuGroupCondition instance + */ + public static create(properties?: google.cloud.channel.v1.ISkuGroupCondition): google.cloud.channel.v1.SkuGroupCondition; + + /** + * Encodes the specified SkuGroupCondition message. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @param message SkuGroupCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ISkuGroupCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkuGroupCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @param message SkuGroupCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ISkuGroupCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkuGroupCondition + * @throws {Error} If the payload is not a 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.SkuGroupCondition; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkuGroupCondition + * @throws {Error} If the payload is 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.SkuGroupCondition; + + /** + * Verifies a SkuGroupCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkuGroupCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkuGroupCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.SkuGroupCondition; + + /** + * Creates a plain object from a SkuGroupCondition message. Also converts values to other types if specified. + * @param message SkuGroupCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.SkuGroupCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkuGroupCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkuGroupCondition + * @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 { diff --git a/packages/google-cloud-channel/protos/protos.js b/packages/google-cloud-channel/protos/protos.js index 11e2391eb56..2cbe30cbddd 100644 --- a/packages/google-cloud-channel/protos/protos.js +++ b/packages/google-cloud-channel/protos/protos.js @@ -14771,6 +14771,7 @@ * @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 + * @property {Array.|null} [conditionalOverrides] RepricingConfig conditionalOverrides */ /** @@ -14782,6 +14783,7 @@ * @param {google.cloud.channel.v1.IRepricingConfig=} [properties] Properties to set */ function RepricingConfig(properties) { + this.conditionalOverrides = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14828,6 +14830,14 @@ */ RepricingConfig.prototype.rebillingBasis = 0; + /** + * RepricingConfig conditionalOverrides. + * @member {Array.} conditionalOverrides + * @memberof google.cloud.channel.v1.RepricingConfig + * @instance + */ + RepricingConfig.prototype.conditionalOverrides = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -14876,6 +14886,9 @@ $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(); + if (message.conditionalOverrides != null && message.conditionalOverrides.length) + for (var i = 0; i < message.conditionalOverrides.length; ++i) + $root.google.cloud.channel.v1.ConditionalOverride.encode(message.conditionalOverrides[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -14930,6 +14943,12 @@ message.rebillingBasis = reader.int32(); break; } + case 6: { + if (!(message.conditionalOverrides && message.conditionalOverrides.length)) + message.conditionalOverrides = []; + message.conditionalOverrides.push($root.google.cloud.channel.v1.ConditionalOverride.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -15003,6 +15022,15 @@ case 2: break; } + if (message.conditionalOverrides != null && message.hasOwnProperty("conditionalOverrides")) { + if (!Array.isArray(message.conditionalOverrides)) + return "conditionalOverrides: array expected"; + for (var i = 0; i < message.conditionalOverrides.length; ++i) { + var error = $root.google.cloud.channel.v1.ConditionalOverride.verify(message.conditionalOverrides[i]); + if (error) + return "conditionalOverrides." + error; + } + } return null; }; @@ -15058,6 +15086,16 @@ message.rebillingBasis = 2; break; } + if (object.conditionalOverrides) { + if (!Array.isArray(object.conditionalOverrides)) + throw TypeError(".google.cloud.channel.v1.RepricingConfig.conditionalOverrides: array expected"); + message.conditionalOverrides = []; + for (var i = 0; i < object.conditionalOverrides.length; ++i) { + if (typeof object.conditionalOverrides[i] !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingConfig.conditionalOverrides: object expected"); + message.conditionalOverrides[i] = $root.google.cloud.channel.v1.ConditionalOverride.fromObject(object.conditionalOverrides[i]); + } + } return message; }; @@ -15074,6 +15112,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.conditionalOverrides = []; if (options.defaults) { object.effectiveInvoiceMonth = null; object.adjustment = null; @@ -15095,6 +15135,11 @@ if (options.oneofs) object.granularity = "channelPartnerGranularity"; } + if (message.conditionalOverrides && message.conditionalOverrides.length) { + object.conditionalOverrides = []; + for (var j = 0; j < message.conditionalOverrides.length; ++j) + object.conditionalOverrides[j] = $root.google.cloud.channel.v1.ConditionalOverride.toObject(message.conditionalOverrides[j], options); + } return object; }; @@ -15940,6 +15985,720 @@ return PercentageAdjustment; })(); + v1.ConditionalOverride = (function() { + + /** + * Properties of a ConditionalOverride. + * @memberof google.cloud.channel.v1 + * @interface IConditionalOverride + * @property {google.cloud.channel.v1.IRepricingAdjustment|null} [adjustment] ConditionalOverride adjustment + * @property {google.cloud.channel.v1.RebillingBasis|null} [rebillingBasis] ConditionalOverride rebillingBasis + * @property {google.cloud.channel.v1.IRepricingCondition|null} [repricingCondition] ConditionalOverride repricingCondition + */ + + /** + * Constructs a new ConditionalOverride. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a ConditionalOverride. + * @implements IConditionalOverride + * @constructor + * @param {google.cloud.channel.v1.IConditionalOverride=} [properties] Properties to set + */ + function ConditionalOverride(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConditionalOverride adjustment. + * @member {google.cloud.channel.v1.IRepricingAdjustment|null|undefined} adjustment + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + */ + ConditionalOverride.prototype.adjustment = null; + + /** + * ConditionalOverride rebillingBasis. + * @member {google.cloud.channel.v1.RebillingBasis} rebillingBasis + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + */ + ConditionalOverride.prototype.rebillingBasis = 0; + + /** + * ConditionalOverride repricingCondition. + * @member {google.cloud.channel.v1.IRepricingCondition|null|undefined} repricingCondition + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + */ + ConditionalOverride.prototype.repricingCondition = null; + + /** + * Creates a new ConditionalOverride instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.IConditionalOverride=} [properties] Properties to set + * @returns {google.cloud.channel.v1.ConditionalOverride} ConditionalOverride instance + */ + ConditionalOverride.create = function create(properties) { + return new ConditionalOverride(properties); + }; + + /** + * Encodes the specified ConditionalOverride message. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.IConditionalOverride} message ConditionalOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adjustment != null && Object.hasOwnProperty.call(message, "adjustment")) + $root.google.cloud.channel.v1.RepricingAdjustment.encode(message.adjustment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rebillingBasis != null && Object.hasOwnProperty.call(message, "rebillingBasis")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rebillingBasis); + if (message.repricingCondition != null && Object.hasOwnProperty.call(message, "repricingCondition")) + $root.google.cloud.channel.v1.RepricingCondition.encode(message.repricingCondition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionalOverride message, length delimited. Does not implicitly {@link google.cloud.channel.v1.ConditionalOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.IConditionalOverride} message ConditionalOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionalOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.ConditionalOverride + * @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.ConditionalOverride} ConditionalOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalOverride.decode = function decode(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.ConditionalOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.adjustment = $root.google.cloud.channel.v1.RepricingAdjustment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rebillingBasis = reader.int32(); + break; + } + case 3: { + message.repricingCondition = $root.google.cloud.channel.v1.RepricingCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionalOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.ConditionalOverride} ConditionalOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionalOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionalOverride message. + * @function verify + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionalOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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; + } + if (message.repricingCondition != null && message.hasOwnProperty("repricingCondition")) { + var error = $root.google.cloud.channel.v1.RepricingCondition.verify(message.repricingCondition); + if (error) + return "repricingCondition." + error; + } + return null; + }; + + /** + * Creates a ConditionalOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.ConditionalOverride} ConditionalOverride + */ + ConditionalOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.ConditionalOverride) + return object; + var message = new $root.google.cloud.channel.v1.ConditionalOverride(); + if (object.adjustment != null) { + if (typeof object.adjustment !== "object") + throw TypeError(".google.cloud.channel.v1.ConditionalOverride.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; + } + if (object.repricingCondition != null) { + if (typeof object.repricingCondition !== "object") + throw TypeError(".google.cloud.channel.v1.ConditionalOverride.repricingCondition: object expected"); + message.repricingCondition = $root.google.cloud.channel.v1.RepricingCondition.fromObject(object.repricingCondition); + } + return message; + }; + + /** + * Creates a plain object from a ConditionalOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {google.cloud.channel.v1.ConditionalOverride} message ConditionalOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionalOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.adjustment = null; + object.rebillingBasis = options.enums === String ? "REBILLING_BASIS_UNSPECIFIED" : 0; + object.repricingCondition = null; + } + 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.repricingCondition != null && message.hasOwnProperty("repricingCondition")) + object.repricingCondition = $root.google.cloud.channel.v1.RepricingCondition.toObject(message.repricingCondition, options); + return object; + }; + + /** + * Converts this ConditionalOverride to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.ConditionalOverride + * @instance + * @returns {Object.} JSON object + */ + ConditionalOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionalOverride + * @function getTypeUrl + * @memberof google.cloud.channel.v1.ConditionalOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionalOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.ConditionalOverride"; + }; + + return ConditionalOverride; + })(); + + v1.RepricingCondition = (function() { + + /** + * Properties of a RepricingCondition. + * @memberof google.cloud.channel.v1 + * @interface IRepricingCondition + * @property {google.cloud.channel.v1.ISkuGroupCondition|null} [skuGroupCondition] RepricingCondition skuGroupCondition + */ + + /** + * Constructs a new RepricingCondition. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a RepricingCondition. + * @implements IRepricingCondition + * @constructor + * @param {google.cloud.channel.v1.IRepricingCondition=} [properties] Properties to set + */ + function RepricingCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepricingCondition skuGroupCondition. + * @member {google.cloud.channel.v1.ISkuGroupCondition|null|undefined} skuGroupCondition + * @memberof google.cloud.channel.v1.RepricingCondition + * @instance + */ + RepricingCondition.prototype.skuGroupCondition = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepricingCondition condition. + * @member {"skuGroupCondition"|undefined} condition + * @memberof google.cloud.channel.v1.RepricingCondition + * @instance + */ + Object.defineProperty(RepricingCondition.prototype, "condition", { + get: $util.oneOfGetter($oneOfFields = ["skuGroupCondition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepricingCondition instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.IRepricingCondition=} [properties] Properties to set + * @returns {google.cloud.channel.v1.RepricingCondition} RepricingCondition instance + */ + RepricingCondition.create = function create(properties) { + return new RepricingCondition(properties); + }; + + /** + * Encodes the specified RepricingCondition message. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.IRepricingCondition} message RepricingCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skuGroupCondition != null && Object.hasOwnProperty.call(message, "skuGroupCondition")) + $root.google.cloud.channel.v1.SkuGroupCondition.encode(message.skuGroupCondition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepricingCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.RepricingCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.IRepricingCondition} message RepricingCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepricingCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.RepricingCondition + * @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.RepricingCondition} RepricingCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingCondition.decode = function decode(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.RepricingCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.skuGroupCondition = $root.google.cloud.channel.v1.SkuGroupCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepricingCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.RepricingCondition} RepricingCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepricingCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepricingCondition message. + * @function verify + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepricingCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.skuGroupCondition != null && message.hasOwnProperty("skuGroupCondition")) { + properties.condition = 1; + { + var error = $root.google.cloud.channel.v1.SkuGroupCondition.verify(message.skuGroupCondition); + if (error) + return "skuGroupCondition." + error; + } + } + return null; + }; + + /** + * Creates a RepricingCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.RepricingCondition} RepricingCondition + */ + RepricingCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.RepricingCondition) + return object; + var message = new $root.google.cloud.channel.v1.RepricingCondition(); + if (object.skuGroupCondition != null) { + if (typeof object.skuGroupCondition !== "object") + throw TypeError(".google.cloud.channel.v1.RepricingCondition.skuGroupCondition: object expected"); + message.skuGroupCondition = $root.google.cloud.channel.v1.SkuGroupCondition.fromObject(object.skuGroupCondition); + } + return message; + }; + + /** + * Creates a plain object from a RepricingCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {google.cloud.channel.v1.RepricingCondition} message RepricingCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepricingCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.skuGroupCondition != null && message.hasOwnProperty("skuGroupCondition")) { + object.skuGroupCondition = $root.google.cloud.channel.v1.SkuGroupCondition.toObject(message.skuGroupCondition, options); + if (options.oneofs) + object.condition = "skuGroupCondition"; + } + return object; + }; + + /** + * Converts this RepricingCondition to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.RepricingCondition + * @instance + * @returns {Object.} JSON object + */ + RepricingCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepricingCondition + * @function getTypeUrl + * @memberof google.cloud.channel.v1.RepricingCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepricingCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.RepricingCondition"; + }; + + return RepricingCondition; + })(); + + v1.SkuGroupCondition = (function() { + + /** + * Properties of a SkuGroupCondition. + * @memberof google.cloud.channel.v1 + * @interface ISkuGroupCondition + * @property {string|null} [skuGroup] SkuGroupCondition skuGroup + */ + + /** + * Constructs a new SkuGroupCondition. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a SkuGroupCondition. + * @implements ISkuGroupCondition + * @constructor + * @param {google.cloud.channel.v1.ISkuGroupCondition=} [properties] Properties to set + */ + function SkuGroupCondition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkuGroupCondition skuGroup. + * @member {string} skuGroup + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @instance + */ + SkuGroupCondition.prototype.skuGroup = ""; + + /** + * Creates a new SkuGroupCondition instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.ISkuGroupCondition=} [properties] Properties to set + * @returns {google.cloud.channel.v1.SkuGroupCondition} SkuGroupCondition instance + */ + SkuGroupCondition.create = function create(properties) { + return new SkuGroupCondition(properties); + }; + + /** + * Encodes the specified SkuGroupCondition message. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.ISkuGroupCondition} message SkuGroupCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkuGroupCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skuGroup != null && Object.hasOwnProperty.call(message, "skuGroup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.skuGroup); + return writer; + }; + + /** + * Encodes the specified SkuGroupCondition message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SkuGroupCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.ISkuGroupCondition} message SkuGroupCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkuGroupCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @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.SkuGroupCondition} SkuGroupCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkuGroupCondition.decode = function decode(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.SkuGroupCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.skuGroup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkuGroupCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.SkuGroupCondition} SkuGroupCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkuGroupCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkuGroupCondition message. + * @function verify + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkuGroupCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.skuGroup != null && message.hasOwnProperty("skuGroup")) + if (!$util.isString(message.skuGroup)) + return "skuGroup: string expected"; + return null; + }; + + /** + * Creates a SkuGroupCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.SkuGroupCondition} SkuGroupCondition + */ + SkuGroupCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.SkuGroupCondition) + return object; + var message = new $root.google.cloud.channel.v1.SkuGroupCondition(); + if (object.skuGroup != null) + message.skuGroup = String(object.skuGroup); + return message; + }; + + /** + * Creates a plain object from a SkuGroupCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {google.cloud.channel.v1.SkuGroupCondition} message SkuGroupCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkuGroupCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.skuGroup = ""; + if (message.skuGroup != null && message.hasOwnProperty("skuGroup")) + object.skuGroup = message.skuGroup; + return object; + }; + + /** + * Converts this SkuGroupCondition to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @instance + * @returns {Object.} JSON object + */ + SkuGroupCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkuGroupCondition + * @function getTypeUrl + * @memberof google.cloud.channel.v1.SkuGroupCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkuGroupCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.SkuGroupCondition"; + }; + + return SkuGroupCondition; + })(); + v1.CloudChannelService = (function() { /** diff --git a/packages/google-cloud-channel/protos/protos.json b/packages/google-cloud-channel/protos/protos.json index 010e18ce203..21ab38129eb 100644 --- a/packages/google-cloud-channel/protos/protos.json +++ b/packages/google-cloud-channel/protos/protos.json @@ -1491,6 +1491,11 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "conditionalOverrides": { + "rule": "repeated", + "type": "ConditionalOverride", + "id": 6 } }, "nested": { @@ -1533,6 +1538,54 @@ } } }, + "ConditionalOverride": { + "fields": { + "adjustment": { + "type": "RepricingAdjustment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rebillingBasis": { + "type": "RebillingBasis", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "repricingCondition": { + "type": "RepricingCondition", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RepricingCondition": { + "oneofs": { + "condition": { + "oneof": [ + "skuGroupCondition" + ] + } + }, + "fields": { + "skuGroupCondition": { + "type": "SkuGroupCondition", + "id": 1 + } + } + }, + "SkuGroupCondition": { + "fields": { + "skuGroup": { + "type": "string", + "id": 1 + } + } + }, "CloudChannelService": { "options": { "(google.api.default_host)": "cloudchannel.googleapis.com", 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 index 2c609bc5595..38703fe5671 100644 --- 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 @@ -29,15 +29,16 @@ function main(reportJob) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The report job created by CloudChannelReportsService.RunReportJob google.cloud.channel.v1.CloudChannelReportsService.RunReportJob. + * 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). + * 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. */ @@ -45,8 +46,10 @@ function main(reportJob) { /** * 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. + * 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' 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 index bf37c0e3bb5..56b561b5f62 100644 --- 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 @@ -29,22 +29,23 @@ function main(parent) { * 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} + * 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. + * 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. + * 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' /** 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 index 8fa60ddbc73..6f1866707ea 100644 --- 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 @@ -29,8 +29,8 @@ function main(name) { * 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, + * 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} @@ -41,8 +41,8 @@ function main(name) { */ // const dateRange = {} /** - * Optional. A structured string that defines conditions on dimension columns to - * restrict the report output. + * 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: 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 index 4f3c8747897..18b3c57f4af 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index c664417d41e..4f89a80116b 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index 67749366e1f..2442ce2baad 100644 --- 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 @@ -40,8 +40,10 @@ function main(name, offer) { */ // 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. + * 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 /** @@ -49,8 +51,9 @@ function main(name, offer) { */ // 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. + * 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 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 index 69c955fbbe2..b4ac8bb935f 100644 --- 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 @@ -35,14 +35,17 @@ function main(name, parameters) { */ // const name = 'abc123' /** - * Required. Entitlement parameters to update. You can only change editable parameters. + * 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. + * 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. + * 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 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 index 71b2d0efda5..a4f56944cbc 100644 --- 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 @@ -39,8 +39,9 @@ function main(name, renewalSettings) { */ // 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. + * 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 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 index ec4b22da1dd..ebddea882f0 100644 --- 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 @@ -29,8 +29,8 @@ function main(parent, channelPartnerRepricingConfig) { * 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: + * 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' 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 index c7ffac50924..869f222ba01 100644 --- 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 @@ -29,8 +29,8 @@ function main(parent, customer) { * 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} + * Required. The resource name of reseller account in which to create the + * customer. Parent uses the format: accounts/{account_id} */ // const parent = 'abc123' /** 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 index d7e9f1980b7..826bdced548 100644 --- 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 @@ -29,8 +29,9 @@ function main(parent, customerRepricingConfig) { * 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} + * 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' /** 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 index f679ab7c6c4..b8659127c46 100644 --- 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 @@ -29,9 +29,9 @@ function main(parent, entitlement) { * 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} + * 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' /** @@ -39,8 +39,9 @@ function main(parent, entitlement) { */ // 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. + * 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 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 index 603a19b09f3..6cc8d7d7392 100644 --- 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 @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the channel partner repricing config rule to delete. + * Required. The resource name of the channel partner repricing config rule to + * delete. */ // const name = 'abc123' 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 index 3337a795604..3722b11cbe5 100644 --- 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 @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the customer repricing config rule to delete. - * Format: + * Required. The resource name of the customer repricing config rule to + * delete. Format: * accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. */ // const name = 'abc123' 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 index 2238a6a769e..790f8400f92 100644 --- 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 @@ -56,9 +56,10 @@ function main(domain, cloudIdentityId, parent, overwriteIfExists) { */ // 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. + * 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' /** 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 index 5e489026828..f15c6488eff 100644 --- 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 @@ -29,22 +29,23 @@ function main(parent) { * 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} + * 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. + * 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. + * 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' /** 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 index 7b94fd53b91..67ae5544814 100644 --- 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 @@ -29,31 +29,34 @@ function main(parent) { * 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: + * 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. + * 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. + * 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 + * 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 = 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 index 10b7419a8a3..147c7372d0c 100644 --- 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 @@ -36,16 +36,18 @@ function main(parent) { */ // 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. + * 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. + * 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' /** 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 index 462fa64938f..c31b53e38ae 100644 --- 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 @@ -34,20 +34,23 @@ function main(parent) { */ // 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 + * 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. + * 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 + * Optional. Filters applied to the CloudChannelService.ListCustomers + * results. See * https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers * for more information. */ 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 index ce44dbcab28..3f8141a1ab0 100644 --- 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 @@ -35,16 +35,18 @@ function main(parent) { */ // 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. + * 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. + * 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' 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 index 1f558b118af..2d5aa523628 100644 --- 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 @@ -29,14 +29,14 @@ function main(parent) { * 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}. + * 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. + * 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 /** 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 index 9f91c77921e..d48a6ed20ec 100644 --- 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 @@ -34,9 +34,9 @@ function main(account) { */ // 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. + * 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 /** 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 index 8c64e9f9784..ce69e278509 100644 --- 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 @@ -42,9 +42,9 @@ function main(customer) { */ // 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. + * 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 /** 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 index ea2114b37a5..bb6bb21c485 100644 --- 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 @@ -42,9 +42,9 @@ function main(customer) { */ // 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. + * 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 /** 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 index 6c85e15d65a..f7c1a1984f1 100644 --- 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 @@ -40,9 +40,9 @@ function main(parent, account) { */ // 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. + * 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 /** 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 index baaa56399db..42416cf9bde 100644 --- 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 @@ -33,10 +33,10 @@ function main(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. + * 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 /** 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 index cbddd152d8e..c4f6fb76c93 100644 --- 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 @@ -50,8 +50,10 @@ function main(parent, sku) { /** * 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. + * 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' /** 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 index feb99ba9ec6..5aa3ba3c98a 100644 --- 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 @@ -54,9 +54,10 @@ function main(parent) { /** * 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. + * 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' /** 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 index a25e0a9dbf1..027099cf1b5 100644 --- 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 @@ -33,7 +33,8 @@ function main(account, serviceAccount) { */ // const account = 'abc123' /** - * Required. Service account that provides subscriber access to the registered topic. + * Required. Service account that provides subscriber access to the registered + * topic. */ // const serviceAccount = 'abc123' 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 index 6140f736ef7..d6989b2956f 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index 736e5f95c44..f908473d2ee 100644 --- 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 @@ -35,8 +35,9 @@ function main(name) { */ // 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. + * 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 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 index 3320c0f434b..f898044ffca 100644 --- 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 @@ -29,9 +29,9 @@ function main(parent, entitlements) { * 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} + * 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' /** @@ -46,8 +46,9 @@ function main(parent, entitlements) { */ // 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. + * 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 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 index ca167240567..f28efb36e02 100644 --- 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 @@ -29,9 +29,9 @@ function main(parent, entitlements) { * 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} + * 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' /** @@ -39,8 +39,9 @@ function main(parent, entitlements) { */ // 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. + * 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 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 index 45cfe161713..2055f05d52c 100644 --- 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 @@ -33,7 +33,8 @@ function main(account, serviceAccount) { */ // const account = 'abc123' /** - * Required. Service account to unregister from subscriber access to the topic. + * Required. Service account to unregister from subscriber access to the + * topic. */ // const serviceAccount = 'abc123' 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 index b21cbef5557..e28cd686492 100644 --- 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 @@ -35,8 +35,8 @@ function main(name, channelPartnerLink, updateMask) { */ // const name = 'abc123' /** - * Required. The channel partner link to update. Only channel_partner_link.link_state - * is allowed for updates. + * Required. The channel partner link to update. Only + * channel_partner_link.link_state is allowed for updates. */ // const channelPartnerLink = {} /** 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 index ab1c91ca689..d79cfb52ef0 100644 --- 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 @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -122,7 +122,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 78, "type": "FULL" } ], @@ -174,7 +174,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -438,7 +438,7 @@ "segments": [ { "start": 25, - "end": 91, + "end": 92, "type": "FULL" } ], @@ -554,7 +554,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 72, "type": "FULL" } ], @@ -602,7 +602,7 @@ "segments": [ { "start": 25, - "end": 96, + "end": 97, "type": "FULL" } ], @@ -666,7 +666,7 @@ "segments": [ { "start": 25, - "end": 88, + "end": 90, "type": "FULL" } ], @@ -770,7 +770,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -818,7 +818,7 @@ "segments": [ { "start": 25, - "end": 79, + "end": 82, "type": "FULL" } ], @@ -870,7 +870,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -918,7 +918,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -974,7 +974,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1018,7 +1018,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1062,7 +1062,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1106,7 +1106,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 69, "type": "FULL" } ], @@ -1150,7 +1150,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 81, "type": "FULL" } ], @@ -1202,7 +1202,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 74, "type": "FULL" } ], @@ -1250,7 +1250,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 75, "type": "FULL" } ], @@ -1478,7 +1478,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 82, "type": "FULL" } ], @@ -1530,7 +1530,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 60, "type": "FULL" } ], @@ -1694,7 +1694,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -1830,7 +1830,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 54, "type": "FULL" } ], @@ -2194,7 +2194,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ], @@ -2238,7 +2238,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ], 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 index d0eb86dbe62..57dd8de5833 100644 --- 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 @@ -127,6 +127,9 @@ export class CloudChannelReportsServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // 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; @@ -443,22 +446,23 @@ export class CloudChannelReportsServiceClient { * 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.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, + * 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. + * 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. @@ -604,26 +608,30 @@ export class CloudChannelReportsServiceClient { >; } /** - * Retrieves data generated by {@link google.cloud.channel.v1.CloudChannelReportsService.RunReportJob|CloudChannelReportsService.RunReportJob}. + * 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}. + * 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). + * 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. + * {@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. @@ -717,21 +725,24 @@ export class CloudChannelReportsServiceClient { * @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}. + * 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). + * 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. + * {@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} @@ -773,21 +784,24 @@ export class CloudChannelReportsServiceClient { * @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}. + * 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). + * 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. + * {@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} @@ -829,18 +843,19 @@ export class CloudChannelReportsServiceClient { * @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} + * 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. + * 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. + * {@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 @@ -933,18 +948,19 @@ export class CloudChannelReportsServiceClient { * @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} + * 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. + * 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. + * {@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 @@ -991,18 +1007,19 @@ export class CloudChannelReportsServiceClient { * @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} + * 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. + * 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. + * {@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 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 index d75630c36be..381ecff4030 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts @@ -50,15 +50,16 @@ const version = require('../../../package.json').version; * 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.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.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. + * - {@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 */ @@ -141,6 +142,9 @@ export class CloudChannelServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // 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; @@ -650,7 +654,8 @@ export class CloudChannelServiceClient { // -- Service calls -- // ------------------- /** - * Returns the requested {@link google.cloud.channel.v1.Customer|Customer} resource. + * Returns the requested {@link google.cloud.channel.v1.Customer|Customer} + * resource. * * Possible error codes: * @@ -756,11 +761,14 @@ export class CloudChannelServiceClient { * * 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) + * 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. + * no + * {@link google.cloud.channel.v1.CloudIdentityCustomerAccount|CloudIdentityCustomerAccount} + * resources match the domain. * * @param {Object} request * The request object that will be sent. @@ -864,8 +872,8 @@ export class CloudChannelServiceClient { ); } /** - * Creates a new {@link google.cloud.channel.v1.Customer|Customer} resource under the reseller or distributor - * account. + * Creates a new {@link google.cloud.channel.v1.Customer|Customer} resource under + * the reseller or distributor account. * * Possible error codes: * @@ -881,8 +889,8 @@ export class CloudChannelServiceClient { * @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} + * 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] @@ -964,15 +972,16 @@ export class CloudChannelServiceClient { return this.innerApiCalls.createCustomer(request, options, callback); } /** - * Updates an existing {@link google.cloud.channel.v1.Customer|Customer} resource for the reseller or - * distributor. + * 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. + * * 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. @@ -1071,7 +1080,8 @@ export class CloudChannelServiceClient { * 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. + * * 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. @@ -1156,10 +1166,10 @@ export class CloudChannelServiceClient { 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. + * 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: * @@ -1194,9 +1204,10 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -1280,7 +1291,8 @@ export class CloudChannelServiceClient { return this.innerApiCalls.importCustomer(request, options, callback); } /** - * Returns the requested {@link google.cloud.channel.v1.Entitlement|Entitlement} resource. + * Returns the requested {@link google.cloud.channel.v1.Entitlement|Entitlement} + * resource. * * Possible error codes: * @@ -1376,7 +1388,8 @@ export class CloudChannelServiceClient { return this.innerApiCalls.getEntitlement(request, options, callback); } /** - * Returns the requested {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * Returns the requested + * {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. * You must be a distributor to call this method. * * Possible error codes: @@ -1388,7 +1401,8 @@ export class CloudChannelServiceClient { * invalid channel partner link name. * * Return value: - * The {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * The {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} + * resource. * * @param {Object} request * The request object that will be sent. @@ -1504,7 +1518,8 @@ export class CloudChannelServiceClient { * Contact Cloud Channel support. * * Return value: - * The new {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * The new {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} + * resource. * * @param {Object} request * The request object that will be sent. @@ -1631,7 +1646,8 @@ export class CloudChannelServiceClient { * Contact Cloud Channel support. * * Return value: - * The updated {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. + * The updated + * {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink} resource. * * @param {Object} request * The request object that will be sent. @@ -1640,8 +1656,8 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -1748,13 +1764,16 @@ export class CloudChannelServiceClient { * * * 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. + * * 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. + * 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. @@ -1859,9 +1878,9 @@ export class CloudChannelServiceClient { /** * 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. + * {@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 @@ -1875,9 +1894,11 @@ export class CloudChannelServiceClient { * 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 + * 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: @@ -1887,20 +1908,23 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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} + * 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] @@ -2003,10 +2027,11 @@ export class CloudChannelServiceClient { * 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}. + * {@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: * @@ -2019,14 +2044,16 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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. @@ -2128,25 +2155,29 @@ export class CloudChannelServiceClient { ); } /** - * 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. + * 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. + * * 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: + * 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. @@ -2250,13 +2281,16 @@ export class CloudChannelServiceClient { * * * 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. + * * 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. + * 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. @@ -2361,9 +2395,10 @@ export class CloudChannelServiceClient { /** * 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. + * 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 @@ -2377,8 +2412,9 @@ export class CloudChannelServiceClient { * 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 + * * 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: @@ -2388,20 +2424,22 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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: + * 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. @@ -2505,10 +2543,11 @@ export class CloudChannelServiceClient { * 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}. + * {@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: * @@ -2521,14 +2560,16 @@ export class CloudChannelServiceClient { * * 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. + * * 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. + * 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. @@ -2630,24 +2671,29 @@ export class CloudChannelServiceClient { ); } /** - * 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. + * 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. + * * 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. + * 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. @@ -2839,7 +2885,8 @@ export class CloudChannelServiceClient { /** * 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} + * subscriber, you get the events through + * {@link google.cloud.channel.v1.SubscriberEvent|SubscriberEvent} * * Possible error codes: * @@ -2860,7 +2907,8 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -2973,7 +3021,8 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -3269,14 +3318,15 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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 @@ -3449,13 +3499,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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. + * 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 @@ -3632,8 +3685,9 @@ export class CloudChannelServiceClient { * @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. + * 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 @@ -3807,13 +3861,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * 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 @@ -3987,8 +4044,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4159,8 +4217,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4336,8 +4395,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4514,8 +4574,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4690,9 +4751,9 @@ export class CloudChannelServiceClient { * @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} + * 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 @@ -4701,8 +4762,9 @@ export class CloudChannelServiceClient { * 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. + * 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 @@ -4877,14 +4939,15 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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 @@ -5039,7 +5102,8 @@ export class CloudChannelServiceClient { * * 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. + * 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. @@ -5047,16 +5111,19 @@ export class CloudChannelServiceClient { * 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 + * 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. + * {@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 + * 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] @@ -5149,16 +5216,19 @@ export class CloudChannelServiceClient { * 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 + * 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. + * {@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 + * 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] @@ -5205,16 +5275,19 @@ export class CloudChannelServiceClient { * 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 + * 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. + * {@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 + * 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] @@ -5252,7 +5325,8 @@ export class CloudChannelServiceClient { ) as AsyncIterable; } /** - * Lists {@link google.cloud.channel.v1.Entitlement|Entitlement}s belonging to a customer. + * Lists {@link google.cloud.channel.v1.Entitlement|Entitlement}s belonging to a + * customer. * * Possible error codes: * @@ -5260,7 +5334,8 @@ export class CloudChannelServiceClient { * * 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. + * A list of the customer's + * {@link google.cloud.channel.v1.Entitlement|Entitlement}s. * * @param {Object} request * The request object that will be sent. @@ -5269,14 +5344,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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. @@ -5374,14 +5451,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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} @@ -5427,14 +5506,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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} @@ -5470,8 +5551,8 @@ export class CloudChannelServiceClient { ) 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. + * 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 @@ -5487,7 +5568,8 @@ export class CloudChannelServiceClient { * * INVALID_ARGUMENT: Required request parameters are missing or invalid. * * Return value: - * A list of the customer's {@link google.cloud.channel.v1.TransferableSku|TransferableSku}. + * A list of the customer's + * {@link google.cloud.channel.v1.TransferableSku|TransferableSku}. * * @param {Object} request * The request object that will be sent. @@ -5509,9 +5591,10 @@ export class CloudChannelServiceClient { * @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. + * {@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 @@ -5632,9 +5715,10 @@ export class CloudChannelServiceClient { * @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. + * {@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 @@ -5703,9 +5787,10 @@ export class CloudChannelServiceClient { * @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. + * {@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 @@ -5751,8 +5836,8 @@ export class CloudChannelServiceClient { ) 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. + * 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 @@ -5769,7 +5854,8 @@ export class CloudChannelServiceClient { * * 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. + * 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. @@ -5787,8 +5873,10 @@ export class CloudChannelServiceClient { * @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. + * {@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] @@ -5905,8 +5993,10 @@ export class CloudChannelServiceClient { * @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. + * {@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] @@ -5967,8 +6057,10 @@ export class CloudChannelServiceClient { * @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. + * {@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] @@ -6010,8 +6102,8 @@ export class CloudChannelServiceClient { ) as AsyncIterable; } /** - * List {@link google.cloud.channel.v1.ChannelPartnerLink|ChannelPartnerLink}s belonging to a distributor. - * You must be a distributor to call this method. + * 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: * @@ -6020,23 +6112,25 @@ export class CloudChannelServiceClient { * * 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. + * 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} + * 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. + * 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. + * {@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] @@ -6136,18 +6230,19 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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. + * {@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] @@ -6191,18 +6286,19 @@ export class CloudChannelServiceClient { * @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} + * 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. + * 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. + * {@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] @@ -6247,14 +6343,17 @@ export class CloudChannelServiceClient { * * * 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. + * * 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: + * 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} @@ -6270,14 +6369,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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 @@ -6388,14 +6489,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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 @@ -6450,14 +6553,16 @@ export class CloudChannelServiceClient { * 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. + * 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. + * {@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 @@ -6508,14 +6613,17 @@ export class CloudChannelServiceClient { * * * 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. + * * 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: + * 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} @@ -6525,25 +6633,28 @@ export class CloudChannelServiceClient { * @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: + * 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. + * 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. + * {@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 + * 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 = @@ -6646,25 +6757,28 @@ export class CloudChannelServiceClient { * @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: + * 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. + * 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. + * {@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 + * 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 = @@ -6712,25 +6826,28 @@ export class CloudChannelServiceClient { * @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: + * 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. + * 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. + * {@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 + * 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 = @@ -6784,9 +6901,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -6879,9 +6996,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -6928,9 +7045,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -6984,9 +7101,9 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -7086,9 +7203,9 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -7144,9 +7261,9 @@ export class CloudChannelServiceClient { * 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. + * 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. @@ -7198,12 +7315,12 @@ export class CloudChannelServiceClient { * @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}. + * 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. + * 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] @@ -7301,12 +7418,12 @@ export class CloudChannelServiceClient { * @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}. + * 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. + * 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] @@ -7360,12 +7477,12 @@ export class CloudChannelServiceClient { * @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}. + * 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. + * 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] @@ -7433,9 +7550,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7542,9 +7659,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7599,9 +7716,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7663,9 +7780,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7772,9 +7889,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7829,9 +7946,9 @@ export class CloudChannelServiceClient { * 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. + * 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] @@ -7896,10 +8013,10 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -8001,10 +8118,10 @@ export class CloudChannelServiceClient { * @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. + * 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. @@ -8054,10 +8171,10 @@ export class CloudChannelServiceClient { * @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. + * 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.